utime.h 2.0 KB

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