Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

39 lines
639 B

  1. #if 0
  2. # include <stdio.h>
  3. #endif
  4. #include <sys/types.h>
  5. #include <time.h>
  6. #include <utime.h>
  7. #include <unistd.h>
  8. struct timeval {
  9. long tv_sec; /* seconds */
  10. long tv_usec; /* and microseconds */
  11. };
  12. int
  13. #if __STDC__
  14. utimes (const char *file, struct timeval *tvp)
  15. #else
  16. utimes (file, tvp)
  17. const char *file;
  18. struct timeval tvp [];
  19. #endif
  20. {
  21. #ifdef _POSIX_SOURCE
  22. struct utimbuf ut;
  23. #else
  24. struct utimebuf ut;
  25. #endif
  26. if (tvp == NULL) {
  27. ut.actime = ut.modtime = time(NULL);
  28. } else {
  29. ut.actime = tvp[0].tv_sec;
  30. ut.modtime = tvp[1].tv_sec;
  31. }
  32. #if 0
  33. printf("time %ld %ld\n", ut.actime, ut.modtime);
  34. #endif
  35. return utime(file, &ut);
  36. }