blob: b2b5741b32099a63b2b02ecb275377b6f9e32f23 [file] [log] [blame]
Rich Felker0b44a032011-02-12 00:22:29 -05001#include <utime.h>
Rich Felkerc37afdf2012-05-24 10:55:58 -04002#include <sys/time.h>
Rich Felker0b44a032011-02-12 00:22:29 -05003#include "syscall.h"
4
5int utime(const char *path, const struct utimbuf *times)
6{
Rich Felkerc37afdf2012-05-24 10:55:58 -04007 if (times) {
8 struct timeval tv[2] = {
9 { .tv_sec = times->actime },
10 { .tv_sec = times->modtime } };
11 return syscall(SYS_utimes, path, tv);
12 }
13 return syscall(SYS_utimes, path, 0);
Rich Felker0b44a032011-02-12 00:22:29 -050014}