#define _GNU_SOURCE #include #include "syscall.h" int futimesat(int dirfd, const char *pathname, const struct timeval times[2]) { #ifdef SYS_futimesat return syscall(SYS_futimesat, dirfd, pathname, times); #else struct timespec ts[2]; if (times) { ts[0].tv_sec = times[0].tv_sec; ts[0].tv_nsec = times[0].tv_usec * 1000; ts[1].tv_sec = times[1].tv_sec; ts[1].tv_nsec = times[1].tv_usec * 1000; } return syscall(SYS_utimensat, dirfd, pathname, times ? ts : 0, 0); #endif }