utimes.c 276 B

12345678910111213141516
  1. #include <utime.h>
  2. #include <sys/time.h>
  3. int utimes(const char *path, struct timeval tvp[2])
  4. {
  5. struct utimbuf buf, *times;
  6. if (tvp) {
  7. times = &buf;
  8. times->actime = tvp[0].tv_sec;
  9. times->modtime = tvp[1].tv_sec;
  10. }
  11. else
  12. times = NULL;
  13. return utime(path, times);
  14. }