struct___timespec64.h 832 B

123456789101112131415161718192021222324252627
  1. #ifndef _STRUCT_TIMESPEC64_H
  2. #define _STRUCT_TIMESPEC64_H
  3. #if __TIMESIZE == 64
  4. # define __timespec64 timespec
  5. #else
  6. #include <endian.h>
  7. /* The glibc Y2038-proof struct __timespec64 structure for a time value.
  8. To keep things Posix-ish, we keep the nanoseconds field a 32-bit
  9. signed long, but since the Linux field is a 64-bit signed int, we
  10. pad our tv_nsec with a 32-bit unnamed bit-field padding.
  11. As a general rule the Linux kernel is ignoring upper 32 bits of
  12. tv_nsec field. */
  13. struct __timespec64
  14. {
  15. __time64_t tv_sec; /* Seconds */
  16. # if BYTE_ORDER == BIG_ENDIAN
  17. __int32_t :32; /* Padding */
  18. __int32_t tv_nsec; /* Nanoseconds */
  19. # else
  20. __int32_t tv_nsec; /* Nanoseconds */
  21. __int32_t :32; /* Padding */
  22. # endif
  23. };
  24. #endif
  25. #endif /* _STRUCT_TIMESPEC64_H */