iconv: add aliases for GBK
[musl.git] / src / stat / futimesat.c
blob4bdb1c2965a909f9c9cf95f3776d0cfc5f852ae3
1 #define _GNU_SOURCE
2 #include <sys/time.h>
3 #include <sys/stat.h>
4 #include <errno.h>
5 #include "syscall.h"
7 int __futimesat(int dirfd, const char *pathname, const struct timeval times[2])
9 struct timespec ts[2];
10 if (times) {
11 int i;
12 for (i=0; i<2; i++) {
13 if (times[i].tv_usec >= 1000000ULL)
14 return __syscall_ret(-EINVAL);
15 ts[i].tv_sec = times[i].tv_sec;
16 ts[i].tv_nsec = times[i].tv_usec * 1000;
19 return utimensat(dirfd, pathname, times ? ts : 0, 0);
22 weak_alias(__futimesat, futimesat);