utimes.c 303 B

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