chiark / gitweb /
[PATCH] sync with latest version of klibc (0.107)
[elogind.git] / klibc / klibc / utime.c
1 /*
2  * utime.c
3  */
4
5 #include <utime.h>
6 #include <sys/time.h>
7 #include <sys/types.h>
8 #include <sys/syscall.h>
9
10 #ifdef __NR_utime
11
12 _syscall2(int,utime,const char *,filename,const struct utimbuf *,buf);
13
14 #else
15
16 static inline _syscall2(int,utimes,const char *,filename, const struct timeval *,tvp);
17
18 int utime(const char *filename, const struct utimbuf *buf)
19 {
20   struct timeval tvp[2];
21
22   tvp[0].tv_sec  = buf->actime;
23   tvp[0].tv_usec = 0;
24   tvp[1].tv_sec  = buf->modtime;
25   tvp[1].tv_usec = 0;
26
27   return utimes(filename, tvp);
28 }
29
30 #endif