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