Mercurial > hg > aboriginal
comparison 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 |
comparison
equal
deleted
inserted
replaced
951:e6fd6f4fe67d | 952:f15bb93793e2 |
---|---|
12 /* Same as `utimes', but takes an open file descriptor instead of a name. */ | 12 /* Same as `utimes', but takes an open file descriptor instead of a name. */ |
13 extern int futimes (int __fd, __const struct timeval __tvp[2]) __THROW; | 13 extern int futimes (int __fd, __const struct timeval __tvp[2]) __THROW; |
14 #endif | 14 #endif |
15 --- /dev/null 2009-08-01 20:56:12.000000000 -0500 | 15 --- /dev/null 2009-08-01 20:56:12.000000000 -0500 |
16 +++ uClibc2/libc/sysdeps/linux/common/futimes.c 2009-11-14 04:53:49.000000000 -0600 | 16 +++ uClibc2/libc/sysdeps/linux/common/futimes.c 2009-11-14 04:53:49.000000000 -0600 |
17 @@ -0,0 +1,33 @@ | 17 @@ -0,0 +1,39 @@ |
18 +/* vi: set sw=4 ts=4: */ | 18 +/* vi: set sw=4 ts=4: */ |
19 +/* | 19 +/* |
20 + * futimes() for uClibc | 20 + * futimes() for uClibc |
21 + * | 21 + * |
22 + * Copyright (C) 2009 Rob Landley <rob@landley.net> | 22 + * Copyright (C) 2009 Rob Landley <rob@landley.net> |
23 + * | 23 + * |
24 + * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball. | 24 + * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball. |
25 + */ | 25 + */ |
26 + | 26 + |
27 +#include <sys/syscall.h> | 27 +#define _SYSCALL_H |
28 +#include <bits/syscalls.h> | |
28 +#include <utime.h> | 29 +#include <utime.h> |
29 +#include <sys/time.h> | 30 +#include <sys/time.h> |
30 + | 31 + |
31 +#ifdef __NR_utimensat | 32 +#ifdef __NR_utimensat |
32 +libc_hidden_proto(futimes) | 33 +libc_hidden_proto(futimes) |
33 + | 34 + |
34 +int futimes(const int fd, const struct timeval tvp[2]) | 35 +int futimes(const int fd, const struct timeval tvp[2]) |
35 +{ | 36 +{ |
36 + struct timespec ts[2], *pts = ts; | 37 + struct timespec ts[2], *pts = ts; |
38 + int ret; | |
39 + INTERNAL_SYSCALL_DECL(err); | |
37 + | 40 + |
38 + /* Convert timeval to timespec, for syscall */ | 41 + /* Convert timeval to timespec, for syscall */ |
39 + | 42 + |
40 + if (tvp) { | 43 + if (tvp) { |
41 + TIMEVAL_TO_TIMESPEC(tvp, ts); | 44 + TIMEVAL_TO_TIMESPEC(tvp, ts); |
42 + TIMEVAL_TO_TIMESPEC(tvp+1, ts+1); | 45 + TIMEVAL_TO_TIMESPEC(tvp+1, ts+1); |
43 + } else pts = 0; | 46 + } else pts = 0; |
44 + | 47 + |
45 + /* Make syscall */ | 48 + /* Make syscall */ |
46 + | 49 + |
47 + return INLINE_SYSCALL(utimensat, 4, fd, 0, pts, 0); | 50 + ret = INTERNAL_SYSCALL_NCS(utimensat, dummy, 4, fd, 0, pts, 0); |
51 + if (INTERNAL_SYSCALL_ERROR_P (ret, err)) | |
52 + return INTERNAL_SYSCALL_ERRNO (ret, err); | |
53 + return 0; | |
48 +} | 54 +} |
49 +libc_hidden_def(futimes) | 55 +libc_hidden_def(futimes) |
50 +#endif | 56 +#endif |