mirror of
git://sourceware.org/git/glibc.git
synced 2025-03-06 20:58:33 +01:00
y2038: Add __USE_TIME_BITS64 support for struct timespec
The __USE_TIME_BITS64 is not defined internally yet. Reviewed-by: Lukasz Majewski <lukma@denx.de> Reviewed-by: Carlos O'Donell <carlos@redhat.com> Tested-by: Carlos O'Donell <carlos@redhat.com>
This commit is contained in:
parent
bdc4782744
commit
c606975bd0
1 changed files with 6 additions and 1 deletions
|
@ -4,15 +4,20 @@
|
||||||
|
|
||||||
#include <bits/types.h>
|
#include <bits/types.h>
|
||||||
#include <bits/endian.h>
|
#include <bits/endian.h>
|
||||||
|
#include <bits/types/time_t.h>
|
||||||
|
|
||||||
/* POSIX.1b structure for a time value. This is like a `struct timeval' but
|
/* POSIX.1b structure for a time value. This is like a `struct timeval' but
|
||||||
has nanoseconds instead of microseconds. */
|
has nanoseconds instead of microseconds. */
|
||||||
struct timespec
|
struct timespec
|
||||||
{
|
{
|
||||||
|
#ifdef __USE_TIME_BITS64
|
||||||
|
__time64_t tv_sec; /* Seconds. */
|
||||||
|
#else
|
||||||
__time_t tv_sec; /* Seconds. */
|
__time_t tv_sec; /* Seconds. */
|
||||||
|
#endif
|
||||||
#if __WORDSIZE == 64 \
|
#if __WORDSIZE == 64 \
|
||||||
|| (defined __SYSCALL_WORDSIZE && __SYSCALL_WORDSIZE == 64) \
|
|| (defined __SYSCALL_WORDSIZE && __SYSCALL_WORDSIZE == 64) \
|
||||||
|| __TIMESIZE == 32
|
|| (__TIMESIZE == 32 && !defined __USE_TIME_BITS64)
|
||||||
__syscall_slong_t tv_nsec; /* Nanoseconds. */
|
__syscall_slong_t tv_nsec; /* Nanoseconds. */
|
||||||
#else
|
#else
|
||||||
# if __BYTE_ORDER == __BIG_ENDIAN
|
# if __BYTE_ORDER == __BIG_ENDIAN
|
||||||
|
|
Loading…
Add table
Reference in a new issue