7 int utimensat(int fd
, const char *path
, const struct timespec times
[2], int flags
)
9 int r
= __syscall(SYS_utimensat
, fd
, path
, times
, flags
);
11 if (r
!= -ENOSYS
|| flags
) return __syscall_ret(r
);
12 struct timeval
*tv
= 0, tmp
[2];
17 if (times
[i
].tv_nsec
>= 1000000000ULL) {
18 if (times
[i
].tv_nsec
== UTIME_NOW
&&
19 times
[1-i
].tv_nsec
== UTIME_NOW
) {
23 if (times
[i
].tv_nsec
== UTIME_OMIT
)
24 return __syscall_ret(-ENOSYS
);
25 return __syscall_ret(-EINVAL
);
27 tmp
[i
].tv_sec
= times
[i
].tv_sec
;
28 tmp
[i
].tv_usec
= times
[i
].tv_nsec
/ 1000;
32 r
= __syscall(SYS_futimesat
, fd
, path
, tv
);
33 if (r
!= -ENOSYS
|| fd
!= AT_FDCWD
) return __syscall_ret(r
);
34 r
= __syscall(SYS_utimes
, path
, tv
);
36 return __syscall_ret(r
);