Mercurial > hg > aboriginal
annotate sources/patches/uClibc-futimes.patch @ 952:f15bb93793e2
INLINE_SYSCALL isn't there on all targets, so switch to stuff that is. (This is kind of disgusting, but the problem's already been fixed in -dev so either there will someday be a new release, or it won't matter.)
author | Rob Landley <rob@landley.net> |
---|---|
date | Thu, 14 Jan 2010 23:47:17 -0600 |
parents | 8c850984c457 |
children |
rev | line source |
---|---|
891
8c850984c457
Upgrades to uClibc: add shm support (Coleman Brumley backported this) and futimes (patch by me).
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
1 User Mode Linux needs futimes(). |
8c850984c457
Upgrades to uClibc: add shm support (Coleman Brumley backported this) and futimes (patch by me).
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
2 |
8c850984c457
Upgrades to uClibc: add shm support (Coleman Brumley backported this) and futimes (patch by me).
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
3 --- uClibc/include/sys/time.h 2005-11-30 11:07:06.000000000 -0600 |
8c850984c457
Upgrades to uClibc: add shm support (Coleman Brumley backported this) and futimes (patch by me).
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
4 +++ uClibc2/include/sys/time.h 2009-11-14 04:55:32.000000000 -0600 |
8c850984c457
Upgrades to uClibc: add shm support (Coleman Brumley backported this) and futimes (patch by me).
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
5 @@ -143,7 +143,9 @@ |
8c850984c457
Upgrades to uClibc: add shm support (Coleman Brumley backported this) and futimes (patch by me).
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
6 /* Same as `utimes', but does not follow symbolic links. */ |
8c850984c457
Upgrades to uClibc: add shm support (Coleman Brumley backported this) and futimes (patch by me).
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
7 extern int lutimes (__const char *__file, __const struct timeval __tvp[2]) |
8c850984c457
Upgrades to uClibc: add shm support (Coleman Brumley backported this) and futimes (patch by me).
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
8 __THROW __nonnull ((1)); |
8c850984c457
Upgrades to uClibc: add shm support (Coleman Brumley backported this) and futimes (patch by me).
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
9 +#endif |
8c850984c457
Upgrades to uClibc: add shm support (Coleman Brumley backported this) and futimes (patch by me).
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
10 |
8c850984c457
Upgrades to uClibc: add shm support (Coleman Brumley backported this) and futimes (patch by me).
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
11 +#ifdef __USE_BSD |
8c850984c457
Upgrades to uClibc: add shm support (Coleman Brumley backported this) and futimes (patch by me).
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
12 /* Same as `utimes', but takes an open file descriptor instead of a name. */ |
8c850984c457
Upgrades to uClibc: add shm support (Coleman Brumley backported this) and futimes (patch by me).
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
13 extern int futimes (int __fd, __const struct timeval __tvp[2]) __THROW; |
8c850984c457
Upgrades to uClibc: add shm support (Coleman Brumley backported this) and futimes (patch by me).
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
14 #endif |
8c850984c457
Upgrades to uClibc: add shm support (Coleman Brumley backported this) and futimes (patch by me).
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
15 --- /dev/null 2009-08-01 20:56:12.000000000 -0500 |
8c850984c457
Upgrades to uClibc: add shm support (Coleman Brumley backported this) and futimes (patch by me).
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
16 +++ uClibc2/libc/sysdeps/linux/common/futimes.c 2009-11-14 04:53:49.000000000 -0600 |
952
f15bb93793e2
INLINE_SYSCALL isn't there on all targets, so switch to stuff that is. (This is kind of disgusting, but the problem's already been fixed in -dev so either there will someday be a new release, or it won't matter.)
Rob Landley <rob@landley.net>
parents:
891
diff
changeset
|
17 @@ -0,0 +1,39 @@ |
891
8c850984c457
Upgrades to uClibc: add shm support (Coleman Brumley backported this) and futimes (patch by me).
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
18 +/* vi: set sw=4 ts=4: */ |
8c850984c457
Upgrades to uClibc: add shm support (Coleman Brumley backported this) and futimes (patch by me).
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
19 +/* |
8c850984c457
Upgrades to uClibc: add shm support (Coleman Brumley backported this) and futimes (patch by me).
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
20 + * futimes() for uClibc |
8c850984c457
Upgrades to uClibc: add shm support (Coleman Brumley backported this) and futimes (patch by me).
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
21 + * |
8c850984c457
Upgrades to uClibc: add shm support (Coleman Brumley backported this) and futimes (patch by me).
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
22 + * Copyright (C) 2009 Rob Landley <rob@landley.net> |
8c850984c457
Upgrades to uClibc: add shm support (Coleman Brumley backported this) and futimes (patch by me).
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
23 + * |
8c850984c457
Upgrades to uClibc: add shm support (Coleman Brumley backported this) and futimes (patch by me).
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
24 + * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball. |
8c850984c457
Upgrades to uClibc: add shm support (Coleman Brumley backported this) and futimes (patch by me).
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
25 + */ |
8c850984c457
Upgrades to uClibc: add shm support (Coleman Brumley backported this) and futimes (patch by me).
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
26 + |
952
f15bb93793e2
INLINE_SYSCALL isn't there on all targets, so switch to stuff that is. (This is kind of disgusting, but the problem's already been fixed in -dev so either there will someday be a new release, or it won't matter.)
Rob Landley <rob@landley.net>
parents:
891
diff
changeset
|
27 +#define _SYSCALL_H |
f15bb93793e2
INLINE_SYSCALL isn't there on all targets, so switch to stuff that is. (This is kind of disgusting, but the problem's already been fixed in -dev so either there will someday be a new release, or it won't matter.)
Rob Landley <rob@landley.net>
parents:
891
diff
changeset
|
28 +#include <bits/syscalls.h> |
891
8c850984c457
Upgrades to uClibc: add shm support (Coleman Brumley backported this) and futimes (patch by me).
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
29 +#include <utime.h> |
8c850984c457
Upgrades to uClibc: add shm support (Coleman Brumley backported this) and futimes (patch by me).
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
30 +#include <sys/time.h> |
8c850984c457
Upgrades to uClibc: add shm support (Coleman Brumley backported this) and futimes (patch by me).
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
31 + |
8c850984c457
Upgrades to uClibc: add shm support (Coleman Brumley backported this) and futimes (patch by me).
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
32 +#ifdef __NR_utimensat |
8c850984c457
Upgrades to uClibc: add shm support (Coleman Brumley backported this) and futimes (patch by me).
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
33 +libc_hidden_proto(futimes) |
8c850984c457
Upgrades to uClibc: add shm support (Coleman Brumley backported this) and futimes (patch by me).
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
34 + |
8c850984c457
Upgrades to uClibc: add shm support (Coleman Brumley backported this) and futimes (patch by me).
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
35 +int futimes(const int fd, const struct timeval tvp[2]) |
8c850984c457
Upgrades to uClibc: add shm support (Coleman Brumley backported this) and futimes (patch by me).
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
36 +{ |
8c850984c457
Upgrades to uClibc: add shm support (Coleman Brumley backported this) and futimes (patch by me).
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
37 + struct timespec ts[2], *pts = ts; |
952
f15bb93793e2
INLINE_SYSCALL isn't there on all targets, so switch to stuff that is. (This is kind of disgusting, but the problem's already been fixed in -dev so either there will someday be a new release, or it won't matter.)
Rob Landley <rob@landley.net>
parents:
891
diff
changeset
|
38 + int ret; |
f15bb93793e2
INLINE_SYSCALL isn't there on all targets, so switch to stuff that is. (This is kind of disgusting, but the problem's already been fixed in -dev so either there will someday be a new release, or it won't matter.)
Rob Landley <rob@landley.net>
parents:
891
diff
changeset
|
39 + INTERNAL_SYSCALL_DECL(err); |
891
8c850984c457
Upgrades to uClibc: add shm support (Coleman Brumley backported this) and futimes (patch by me).
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
40 + |
8c850984c457
Upgrades to uClibc: add shm support (Coleman Brumley backported this) and futimes (patch by me).
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
41 + /* Convert timeval to timespec, for syscall */ |
8c850984c457
Upgrades to uClibc: add shm support (Coleman Brumley backported this) and futimes (patch by me).
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
42 + |
8c850984c457
Upgrades to uClibc: add shm support (Coleman Brumley backported this) and futimes (patch by me).
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
43 + if (tvp) { |
8c850984c457
Upgrades to uClibc: add shm support (Coleman Brumley backported this) and futimes (patch by me).
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
44 + TIMEVAL_TO_TIMESPEC(tvp, ts); |
8c850984c457
Upgrades to uClibc: add shm support (Coleman Brumley backported this) and futimes (patch by me).
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
45 + TIMEVAL_TO_TIMESPEC(tvp+1, ts+1); |
8c850984c457
Upgrades to uClibc: add shm support (Coleman Brumley backported this) and futimes (patch by me).
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
46 + } else pts = 0; |
8c850984c457
Upgrades to uClibc: add shm support (Coleman Brumley backported this) and futimes (patch by me).
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
47 + |
8c850984c457
Upgrades to uClibc: add shm support (Coleman Brumley backported this) and futimes (patch by me).
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
48 + /* Make syscall */ |
8c850984c457
Upgrades to uClibc: add shm support (Coleman Brumley backported this) and futimes (patch by me).
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
49 + |
952
f15bb93793e2
INLINE_SYSCALL isn't there on all targets, so switch to stuff that is. (This is kind of disgusting, but the problem's already been fixed in -dev so either there will someday be a new release, or it won't matter.)
Rob Landley <rob@landley.net>
parents:
891
diff
changeset
|
50 + ret = INTERNAL_SYSCALL_NCS(utimensat, dummy, 4, fd, 0, pts, 0); |
f15bb93793e2
INLINE_SYSCALL isn't there on all targets, so switch to stuff that is. (This is kind of disgusting, but the problem's already been fixed in -dev so either there will someday be a new release, or it won't matter.)
Rob Landley <rob@landley.net>
parents:
891
diff
changeset
|
51 + if (INTERNAL_SYSCALL_ERROR_P (ret, err)) |
f15bb93793e2
INLINE_SYSCALL isn't there on all targets, so switch to stuff that is. (This is kind of disgusting, but the problem's already been fixed in -dev so either there will someday be a new release, or it won't matter.)
Rob Landley <rob@landley.net>
parents:
891
diff
changeset
|
52 + return INTERNAL_SYSCALL_ERRNO (ret, err); |
f15bb93793e2
INLINE_SYSCALL isn't there on all targets, so switch to stuff that is. (This is kind of disgusting, but the problem's already been fixed in -dev so either there will someday be a new release, or it won't matter.)
Rob Landley <rob@landley.net>
parents:
891
diff
changeset
|
53 + return 0; |
891
8c850984c457
Upgrades to uClibc: add shm support (Coleman Brumley backported this) and futimes (patch by me).
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
54 +} |
8c850984c457
Upgrades to uClibc: add shm support (Coleman Brumley backported this) and futimes (patch by me).
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
55 +libc_hidden_def(futimes) |
8c850984c457
Upgrades to uClibc: add shm support (Coleman Brumley backported this) and futimes (patch by me).
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
56 +#endif |