annotate sources/patches/uClibc-futimes.patch @ 891:8c850984c457

Upgrades to uClibc: add shm support (Coleman Brumley backported this) and futimes (patch by me).
author Rob Landley <rob@landley.net>
date Wed, 18 Nov 2009 18:36:53 -0600
parents
children f15bb93793e2
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
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
8c850984c457 Upgrades to uClibc: add shm support (Coleman Brumley backported this) and futimes (patch by me).
Rob Landley <rob@landley.net>
parents:
diff changeset
17 @@ -0,0 +1,33 @@
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 +
8c850984c457 Upgrades to uClibc: add shm support (Coleman Brumley backported this) and futimes (patch by me).
Rob Landley <rob@landley.net>
parents:
diff changeset
27 +#include <sys/syscall.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
28 +#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
29 +#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
30 +
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 +#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
32 +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
33 +
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 +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
35 +{
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 + struct timespec ts[2], *pts = 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
37 +
8c850984c457 Upgrades to uClibc: add shm support (Coleman Brumley backported this) and futimes (patch by me).
Rob Landley <rob@landley.net>
parents:
diff changeset
38 + /* 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
39 +
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 + 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
41 + 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
42 + 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
43 + } 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
44 +
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 + /* 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
46 +
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 + return INLINE_SYSCALL(utimensat, 4, fd, 0, 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
48 +}
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 +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
50 +#endif