[PATCH v2] Always define __USE_TIME_BITS64
Andreas Schwab
schwab@suse.de
Thu Jan 18 11:51:38 GMT 2024
On Jan 18 2024, Adhemerval Zanella wrote:
> diff --git a/sysdeps/unix/sysv/linux/features-time64.h b/sysdeps/unix/sysv/linux/features-time64.h
> index dd3442c2ea..ea05271a72 100644
> --- a/sysdeps/unix/sysv/linux/features-time64.h
> +++ b/sysdeps/unix/sysv/linux/features-time64.h
> @@ -24,9 +24,8 @@
> # if _TIME_BITS == 64
> # if ! defined (_FILE_OFFSET_BITS) || _FILE_OFFSET_BITS != 64
> # error "_TIME_BITS=64 is allowed only with _FILE_OFFSET_BITS=64"
> -# elif __TIMESIZE == 32
> -# define __USE_TIME_BITS64 1
> # endif
> +# define __USE_TIME_BITS64 1
> # elif _TIME_BITS == 32
> # if __TIMESIZE > 32
> # error "_TIME_BITS=32 is not compatible with __TIMESIZE > 32"
> @@ -34,4 +33,14 @@
> # else
> # error Invalid _TIME_BITS value (can only be 32 or 64-bit)
> # endif
> +#else
> +# if __TIMESIZE == 64
> +# define __USE_TIME_BITS64 1
> +# else
> +# define __USE_TIME_BITS64 0
According to the y2038 docs, __USE_TIME_BITS64 should _only_ be defined
if time_t is 64-bit wide (and the kernel header follows this by using
defined(__USE_TIME_BITS64)). If _TIME_BITS=32 then __USE_TIME_BITS64
continues to be undefined.
--
Andreas Schwab, SUSE Labs, schwab@suse.de
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE 1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."
More information about the Libc-alpha
mailing list