utime.h 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  1. /*++
  2. Copyright (c) 2013 Minoca Corp.
  3. This file is licensed under the terms of the GNU Lesser General Public
  4. License version 3. Alternative licensing terms are available. Contact
  5. info@minocacorp.com for details.
  6. Module Name:
  7. utime.h
  8. Abstract:
  9. This header contains definitions for modifying file modification and
  10. access times.
  11. Author:
  12. Evan Green 3-Jul-2013
  13. --*/
  14. #ifndef _UTIME_H
  15. #define _UTIME_H
  16. //
  17. // ------------------------------------------------------------------- Includes
  18. //
  19. #include <sys/types.h>
  20. //
  21. // ---------------------------------------------------------------- Definitions
  22. //
  23. #ifdef __cplusplus
  24. extern "C" {
  25. #endif
  26. //
  27. // ------------------------------------------------------ Data Type Definitions
  28. //
  29. /*++
  30. Structure Description:
  31. This structure defines the times buffer used to pass a file modification and
  32. access time around together.
  33. Members:
  34. actime - Stores the file access time.
  35. modtime - Stores the file modification time.
  36. --*/
  37. struct utimbuf {
  38. time_t actime;
  39. time_t modtime;
  40. };
  41. //
  42. // -------------------------------------------------------------------- Globals
  43. //
  44. //
  45. // -------------------------------------------------------- Function Prototypes
  46. //
  47. LIBC_API
  48. int
  49. utime (
  50. const char *Path,
  51. const struct utimbuf *Times
  52. );
  53. /*++
  54. Routine Description:
  55. This routine sets the access and modification times of the given file. The
  56. effective user ID of the process must match the owner of the file, or the
  57. process must have appropriate privileges.
  58. Arguments:
  59. Path - Supplies a pointer to the path of the file to change times for.
  60. Times - Supplies an optional pointer to a time buffer structure containing
  61. the access and modification times to set. If this parameter is NULL,
  62. the current time will be used.
  63. Return Value:
  64. 0 on success.
  65. -1 on failure, and errno will be set to contain more information.
  66. --*/
  67. #ifdef __cplusplus
  68. }
  69. #endif
  70. #endif