1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
| | #define _GNU_SOURCE
#include <sys/time.h>
#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
}
|