# --- 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.32/include/fcntl.h.vanilla 2011-01-06 11:51:39.000000000 +0100 +++ dietlibc-0.32/include/fcntl.h 2011-01-06 11:52:13.000000000 +0100 @@ -666,7 +666,7 @@ int symlinkat(const char *oldpath, int newdirfd, const char *newpath); int unlinkat(int dirfd, const char *pathname, int flags); int mkfifoat(int dirfd, const char *pathname, mode_t mode); -int utimensat(int dirfd, const char *pathname, struct timespec* t); +int utimensat(int dirfd, const char *pathname, const struct timespec times[2], int flags); #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); +}