etc/services - sync with NetBSD-8
[minix.git] / minix / lib / libc / sys / futimes.c
blobdf8774ac3d113a9031ba8a2b370335270bddd44e
1 #include <sys/cdefs.h>
2 #include "namespace.h"
3 #include <lib.h>
5 #include <string.h>
6 #include <sys/stat.h>
7 #include <sys/time.h>
9 #ifdef __weak_alias
10 __weak_alias(futimes, __futimes50)
11 #endif
13 int futimes(int fd, const struct timeval tv[2])
15 message m;
17 memset(&m, 0, sizeof(m));
18 m.m_vfs_utimens.fd = fd;
19 if (tv == NULL) {
20 m.m_vfs_utimens.atime = m.m_vfs_utimens.mtime = 0;
21 m.m_vfs_utimens.ansec = m.m_vfs_utimens.mnsec = UTIME_NOW;
23 else {
24 m.m_vfs_utimens.atime = tv[0].tv_sec;
25 m.m_vfs_utimens.mtime = tv[1].tv_sec;
26 m.m_vfs_utimens.ansec = tv[0].tv_usec * 1000;
27 m.m_vfs_utimens.mnsec = tv[1].tv_usec * 1000;
29 m.m_vfs_utimens.name = NULL;
30 m.m_vfs_utimens.flags = 0;
32 return(_syscall(VFS_PROC_NR, VFS_UTIMENS, &m));