cpio_windows.h 990 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. /*-
  2. * SPDX-License-Identifier: BSD-2-Clause
  3. *
  4. * Copyright (c) 2009 Michihiro NAKAJIMA
  5. * All rights reserved.
  6. */
  7. #ifndef CPIO_WINDOWS_H
  8. #define CPIO_WINDOWS_H 1
  9. #include <windows.h>
  10. #include <io.h>
  11. #include <string.h>
  12. #define getgrgid(id) NULL
  13. #define getgrnam(name) NULL
  14. #define getpwnam(name) NULL
  15. #define getpwuid(id) NULL
  16. #if defined(_MSC_VER)
  17. #if _MSC_VER < 1900
  18. #define snprintf sprintf_s
  19. #endif // _MSC_VER < 1900
  20. #define strdup _strdup
  21. #define open _open
  22. #define read _read
  23. #define close _close
  24. #endif
  25. struct passwd {
  26. char *pw_name;
  27. uid_t pw_uid;
  28. gid_t pw_gid;
  29. };
  30. struct group {
  31. char *gr_name;
  32. gid_t gr_gid;
  33. };
  34. struct _timeval64i32 {
  35. time_t tv_sec;
  36. long tv_usec;
  37. };
  38. #define __timeval _timeval64i32
  39. extern int futimes(int fd, const struct __timeval *times);
  40. #ifndef HAVE_FUTIMES
  41. #define HAVE_FUTIMES 1
  42. #endif
  43. extern int utimes(const char *name, const struct __timeval *times);
  44. #ifndef HAVE_UTIMES
  45. #define HAVE_UTIMES 1
  46. #endif
  47. #endif /* !CPIO_WINDOWS_H */