This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [RFC v4 06/24] sysdeps/timespec_get: Use clock_gettime64 if avaliable
- From: Joseph Myers <joseph at codesourcery dot com>
- To: Alistair Francis <alistair23 at gmail dot com>
- Cc: 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 <palmer at sifive dot com>, <macro at wdc dot com>, Zong Li <zongbox at gmail dot com>
- Date: Thu, 15 Aug 2019 20:59:02 +0000
- Subject: Re: [RFC v4 06/24] sysdeps/timespec_get: Use clock_gettime64 if avaliable
- Ironport-sdr: IweHFQOm4CG4e9fEFh5jE6Zhx3liACaBUmT/AJXxu0yWj8sLCkCMC88ukdCbCb0WrEGiDRearZ 6F8r2xXKwSi8nozWBdg+AfEQei+lpFNmpeePZCKqimVwrksC2T0Xb1fXTUxtgGk75KZxoA2bLW iTNJCMV2jzvpxbbyy9wfBw04ugDqmWCfjjdYwyIuXYKdJxMhxg3ptYwT4VRG79HcInN2J/eRsn hpidMucch22qUnnxmNll7y5ZE2kmCT5MC+nlamr031oqoRfXy5i7XIzaAcf/7tmrYPlBzfS4gy wuw=
- Ironport-sdr: W4Pg6iqcuCo/W4QDKoptJo4MXih/Ycdnn8voBBvyfjbo500h/c0bmjijQcWPR5QVv/xZxihoyH ZWZwForoxp/ot8t9mNHrCx+jnw4SLAQfc8jGN/sucWyz0tldGCciCrrxFUf9m5Is3QEjr4tidb pqFJNJCkMdMTumwNkqNvJy39/mijzhsJyiGQNqVub2eY/z67BksR4h/S+S84Qp4QvAF9KUOsif nQjLRePRwJMVMRbuv7/fo7iWU7JsvdrF7GA8v1tcUKSVENcIurpX3POujVbkiltn6gwtNONRhY ZhU=
- References: <cover.1565398513.git.alistair.francis@wdc.com> <3ee6c1e52cbefe6f6dbd7aef423f13607ff50402.1565398513.git.alistair.francis@wdc.com> <alpine.DEB.2.21.1908121946160.18203@digraph.polyomino.org.uk> <CAKmqyKOm_j5_v45oLj+RXMZQP297QVZ54Obww9enzcp4maRHKA@mail.gmail.com> <alpine.DEB.2.21.1908151938180.31825@digraph.polyomino.org.uk> <CAKmqyKMGXkeUaGy=Yu+=RWq0wSNVE1pTy-_3tEA44ikVNVmUZA@mail.gmail.com>
On Thu, 15 Aug 2019, Alistair Francis wrote:
> Ok, so more like this?
>
> #if __TIMESIZE == 64
> # define timespec_get __timespec_get64
> #else
> # define timespec_get __timespec_get32
> #endif
No. Please see what's done for mktime, for example (but it's simpler here
because mktime supports being built outside of glibc, which is irrelevant
for timespec_get).
* The function __mktime64 is defined, unconditionally.
* The function mktime is defined as a thin wrapper, conditionally (only
when 32-bit time is supported).
* There's no __mktime32 anywhere.
* mktime-internal.h deals with defining __mktime64 back to mktime in the
case where __TIMESIZE == 64 and so only a single function is needed with
no wrapper.
> > # ifndef __NR_clock_gettime64
> > # define __NR_clock_gettime64 __NR_clock_gettime
> > # endif
> >
> > here, because 64-bit platforms define __ASSUME_TIME64_SYSCALLS but with
> > unsuffixed syscall names.
>
> The kernel defines 64 suffixed syscalls, is this required because
> older kernels don't do this?
The kernel does *not* define 64-suffixed syscalls on platforms where
__SYSCALL_WORDSIZE == 64. It defined unsuffixed syscalls with the same
semantics.
--
Joseph S. Myers
joseph@codesourcery.com