summaryrefslogtreecommitdiff
path: root/src/time/utime.c
blob: b2b5741b32099a63b2b02ecb275377b6f9e32f23 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
#include <utime.h>
#include <sys/time.h>
#include "syscall.h"

int utime(const char *path, const struct utimbuf *times)
{
	if (times) {
		struct timeval tv[2] = {
			{ .tv_sec = times->actime },
			{ .tv_sec = times->modtime } };
		return syscall(SYS_utimes, path, tv);
	}
	return syscall(SYS_utimes, path, 0);
}