1
0
mirror of https://sourceware.org/git/glibc.git synced 2025-12-24 17:51:17 +03:00

Always define __USE_TIME_BITS64 when 64 bit time_t is used

It was raised on libc-help [1] that some Linux kernel interfaces expect
the libc to define __USE_TIME_BITS64 to indicate the time_t size for the
kABI.  Different than defined by the initial y2038 design document [2],
the __USE_TIME_BITS64 is only defined for ABIs that support more than
one time_t size (by defining the _TIME_BITS for each module).

The 64 bit time_t redirects are now enabled using a different internal
define (__USE_TIME64_REDIRECTS). There is no expected change in semantic
or code generation.

Checked on x86_64-linux-gnu, i686-linux-gnu, aarch64-linux-gnu, and
arm-linux-gnueabi

[1] https://sourceware.org/pipermail/libc-help/2024-January/006557.html
[2] https://sourceware.org/glibc/wiki/Y2038ProofnessDesign

Reviewed-by: DJ Delorie <dj@redhat.com>
This commit is contained in:
Adhemerval Zanella
2024-01-18 10:18:01 -03:00
parent a0698a5e92
commit a4ed0471d7
75 changed files with 178 additions and 182 deletions

View File

@@ -64,7 +64,7 @@
# define SO_TIMESTAMPNS_NEW 64
# define SO_TIMESTAMPING_NEW 65
# ifdef __USE_TIME_BITS64
# ifdef __USE_TIME64_REDIRECTS
# define SO_RCVTIMEO SO_RCVTIMEO_NEW
# define SO_SNDTIMEO SO_SNDTIMEO_NEW
# define SO_TIMESTAMP SO_TIMESTAMP_NEW

View File

@@ -77,7 +77,7 @@ __BEGIN_DECLS
/* Tune a POSIX clock. */
extern int clock_adjtime (__clockid_t __clock_id, struct timex *__utx) __THROW __nonnull((2));
#ifdef __USE_TIME_BITS64
#ifdef __USE_TIME64_REDIRECTS
# if defined(__REDIRECT_NTH)
extern int __REDIRECT_NTH (clock_adjtime, (__clockid_t __clock_id,
struct timex *__utx),

View File

@@ -25,7 +25,7 @@
struct timex
{
# if defined __USE_TIME_BITS64 || (__TIMESIZE == 64 && __WORDSIZE == 32)
# if defined __USE_TIME64_REDIRECTS || (__TIMESIZE == 64 && __WORDSIZE == 32)
unsigned int modes; /* mode selector */
int :32; /* pad */
long long offset; /* time offset (usec) */

View File

@@ -26,7 +26,7 @@
The type `struct msg' is opaque. */
struct msqid_ds
{
#ifdef __USE_TIME_BITS64
#ifdef __USE_TIME64_REDIRECTS
# include <bits/types/struct_msqid64_ds_helper.h>
#else
struct ipc_perm msg_perm; /* structure describing operation permission */

View File

@@ -23,7 +23,7 @@
/* Data structure describing a set of semaphores. */
struct semid_ds
{
#ifdef __USE_TIME_BITS64
#ifdef __USE_TIME64_REDIRECTS
# include <bits/types/struct_semid64_ds_helper.h>
#else
struct ipc_perm sem_perm; /* operation permission struct */

View File

@@ -23,7 +23,7 @@
/* Data structure describing a shared memory segment. */
struct shmid_ds
{
#ifdef __USE_TIME_BITS64
#ifdef __USE_TIME64_REDIRECTS
# include <bits/types/struct_shmid64_ds_helper.h>
#else
struct ipc_perm shm_perm; /* operation permission struct */