aboutsummaryrefslogtreecommitdiff
path: root/src/time/utime.c
blob: c5d3ef07bd458470fe4af90e921f415beb437f21 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#include <utime.h>
#include <sys/stat.h>
#include <time.h>
#include <fcntl.h>

int utime(const char *path, const struct utimbuf *times)
{
	return utimensat(AT_FDCWD, path, times ? ((struct timespec [2]){
		{ .tv_sec = times->actime }, { .tv_sec = times->modtime }})
		: 0, 0);
}


#ifdef TEST
int
main(void) {
	return 0;
}
#endif