1
0

utime.c 279 B

1234567891011
  1. #include <utime.h>
  2. #include <sys/stat.h>
  3. #include <time.h>
  4. #include <fcntl.h>
  5. int utime(const char *path, const struct utimbuf *times)
  6. {
  7. return utimensat(AT_FDCWD, path, times ? ((struct timespec [2]){
  8. { .tv_sec = times->actime }, { .tv_sec = times->modtime }})
  9. : 0, 0);
  10. }