This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [RFC v6 04/23] linux: Use 32-bit time_t for itimerval
- From: Joseph Myers <joseph at codesourcery dot com>
- To: Alistair Francis <alistair23 at gmail dot com>
- Cc: Lukasz Majewski <lukma at denx dot de>, Alistair Francis <alistair dot francis at wdc dot com>, GNU C Library <libc-alpha at sourceware dot org>, Arnd Bergmann <arnd at arndb dot de>, Adhemerval Zanella <adhemerval dot zanella at linaro dot org>, Florian Weimer <fweimer at redhat dot com>, Palmer Dabbelt <palmerdabbelt at google dot com>, "Maciej W. Rozycki" <macro at wdc dot com>, Zong Li <zongbox at gmail dot com>
- Date: Thu, 16 Jan 2020 01:21:35 +0000
- Subject: Re: [RFC v6 04/23] linux: Use 32-bit time_t for itimerval
- Ironport-sdr: GGj9ZjGrLdLk3UEtdyBrsGmUlrCT/jkEUxfmYJ23ju+dwohEiH3A6xG5mKFu3QKQm0emCc97Kv dt9gUoop52mXpQo1cy7fyzwWxzmGJFDtCEYFHfw6S0+aZcYNGaGnbKZ50gfyFlpko5v9e8V00p iBgsZt152AfGU2ZoRCu42U8x8WDC55Ty2ege5B+8f9n0R5Tf7HQSm3VZ25jlxUqZHfXlNCTGyt DiRBXM5BKwbFuxv1gLR+fghkRxv0nI+yi6hOiOGjc+k3P1rBOi6kULs4RF7WJs/kjLA4UWQ+p5 p70=
- Ironport-sdr: 9XxfBxSCOvxrICKkzL06vn+iPNgiSO8a53F7k4NqYlWoJe1suk1oJmnsv1xqAVu4UZbmuN+Lmo iLyGKNk06OczMvyoglo+NdINJEDjII3SjNvC4005L5KGV72lcHqc2IznsFmTUaX7YJT4yhEyqX If4mpLJfFPUUCZW3iSPnhm1n8PpdVwfPl8KtsgViIoDr1DXltkw9LScjFFboZ8maiPWnwY9TU3 CJP9NLQgNZtonRVXm8nqsVyvm9s96719RN/mNszmaJHqiqaGE3JkcQ1T5RF/Lg9b1/zE1O7pSK Mlw=
- References: <cover.1578824547.git.alistair.francis@wdc.com> <6fce89fec812352770884a62c6fa158890480e2a.1578824547.git.alistair.francis@wdc.com> <20200114115848.396c6eaf@jawa> <CAKmqyKN1noTcCVMSCfS_wNOCGOtssaB9bDJ16JafMzUzvnmpcA@mail.gmail.com>
On Thu, 16 Jan 2020, Alistair Francis wrote:
> > To allow it this syscall wrapper shall be converted (written) in the
> > same way as e.g:
> >
> > ./sysdeps/unix/sysv/linux/clock_settime.c
> >
> > (the same issue is with getitimer).
> >
> > Then only redirection when __USE_TIME_BITS64 is set are needed to use
> > __setitimer64/__getitimer64 on Y2038 safe systems.
>
> I'm not sure what you mean here.
>
> There is no setitimer64/getitimer64 syscall so we need to make sure we
> pass a 32-bit time_t here. If __TIMESIZE == 32 then we don't need any
> changes and can just directly make the syscall (as we do in this
> patch). The conversion is only required if __TIMESIZE == 64 as we need
> to convert to/from a 32-bit time_t.
This is a point about the general structure and goals of the Y2038 work.
We want to end up at a point where, on systems where time_t is currently
32-bit, you can build with -D_TIME_BITS=64 and get 64-bit time_t instead.
That means that all time-related functions, including getitimer and
setitimer, will, on such systems, need to have two implementations in
glibc, one using 64-bit times and one using 32-bit times.
The implementation structure generally being used is that the main
implementation has an interface using 64-bit times (even if it ends up
using syscalls with 32-bit times) and the one using 32-bit times is a thin
wrapper around it (if time_t is already 64-bit, the second implementation
does not exist and some macros ensure the first implementation keeps its
existing name). Once all functions have been moved to that structure, we
can set things up so that all those 64-bit functions are exported from
glibc and add _TIME_BITS support in the headers.
--
Joseph S. Myers
joseph@codesourcery.com