Dash:
[t2.git] / package / base / dietlibc / lutimes.patch
blobace51e69cc370e81e527ff0de1fc0dff8696fab4
1 # --- T2-COPYRIGHT-NOTE-BEGIN ---
2 # This copyright note is auto-generated by ./scripts/Create-CopyPatch.
3 #
4 # T2 SDE: package/.../dietlibc/lutimes.patch
5 # Copyright (C) 2010 - 2011 The T2 SDE Project
6 #
7 # More information can be found in the files COPYING and README.
8 #
9 # This patch file is dual-licensed. It is available under the license the
10 # patched project is licensed under, as long as it is an OpenSource license
11 # as defined at http://www.opensource.org/ (e.g. BSD, X11) or under the terms
12 # of the GNU General Public License as published by the Free Software
13 # Foundation; either version 2 of the License, or (at your option) any later
14 # version.
15 # --- T2-COPYRIGHT-NOTE-END ---
17 For udev, too, ...
19 - Rene Rebe <rene@exactcode.de>
21 --- /dev/null 2010-10-27 14:43:31.488782000 +0200
22 +++ dietlibc/syscalls.s/utimesat.S 2010-11-13 12:49:56.000000000 +0100
23 @@ -0,0 +1,3 @@
24 +#include "syscalls.h"
26 +syscall(utimensat,utimensat)
27 --- dietlibc-0.33/include/fcntl.h.orig 2014-06-17 14:55:15.000000000 +0200
28 +++ dietlibc-0.33/include/fcntl.h 2014-06-17 14:58:09.000000000 +0200
29 @@ -664,7 +664,7 @@
30 #define AT_SYMLINK_FOLLOW 0x400 /* Follow symbolic links. */
32 int openat(int dirfd, const char *pathname, int flags, ...) __THROW;
33 -int futimesat(int dirfd, const char *pathname, const struct timeval times[2]) __THROW;
34 +int futimesat(int dirfd, const char *pathname, const struct timeval times[2], int flags) __THROW;
35 int unlinkat(int dirfd, const char *pathname, int flags) __THROW;
36 #endif
38 --- /dev/null 2010-10-27 14:43:31.488782000 +0200
39 +++ dietlibc/lib/lutimes.c 2010-11-13 12:54:09.000000000 +0100
40 @@ -0,0 +1,16 @@
41 +#define _GNU_SOURCE
42 +#include <sys/types.h>
43 +#include <fcntl.h>
45 +#ifndef TIMEVAL_TO_TIMESPEC
46 +#define TIMEVAL_TO_TIMESPEC(tv, ts) { \
47 +(ts)->tv_sec = (tv)->tv_sec; \
48 +(ts)->tv_nsec = (tv)->tv_usec * 1000; \
50 +#endif
52 +int lutimes(const char *file, const struct timeval tv[2]);
53 +int lutimes(const char *file, const struct timeval tv[2]) {
54 + struct timespec ts[2]; TIMEVAL_TO_TIMESPEC(&tv[0], &ts[0]); TIMEVAL_TO_TIMESPEC(&tv[1], &ts[1]);
55 + return utimensat(AT_FDCWD, file, tv ? ts : NULL, AT_SYMLINK_NOFOLLOW);