summaryrefslogtreecommitdiff
path: root/lib/libc/utime/utime.c
blob: 896f83425074d3fa1bd5f18a026a76d125403cd8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
#include <sys/time.h> // for timeval, utimes
#include <utime.h>    // for utimbuf, utime

int utime(const char *filename, const struct utimbuf *buf)
{
	struct timeval tvp[2];

	tvp[0].tv_sec = buf->actime;
	tvp[0].tv_usec = 0;
	tvp[1].tv_sec = buf->modtime;
	tvp[1].tv_usec = 0;

	return utimes(filename, tvp);
}