1 /* vi: set sw=4 ts=4: */
3 * lutimes() implementation for uClibc
5 * Copyright (C) 2010 Vladimir Zapolskiy <vzapolskiy@gmail.com>
7 * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
10 #include <sys/syscall.h>
14 _syscall2(int, lutimes, const char *, file, const struct timeval *, tvp)
19 int lutimes(const char *file, const struct timeval tvp[2])
21 struct timespec ts[2];
25 if (tvp[0].tv_usec < 0 || tvp[0].tv_usec >= 1000000
26 || tvp[1].tv_usec < 0 || tvp[1].tv_usec >= 1000000)
32 TIMEVAL_TO_TIMESPEC(&tvp[0], &ts[0]);
33 TIMEVAL_TO_TIMESPEC(&tvp[1], &ts[1]);
36 return utimensat(AT_FDCWD, file, tvp ? ts : NULL, AT_SYMLINK_NOFOLLOW);