This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [RFC v4 06/24] sysdeps/timespec_get: Use clock_gettime64 if avaliable


On Thu, Aug 15, 2019 at 1:59 PM Joseph Myers <joseph@codesourcery.com> wrote:
>
> 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.

There is no internal header for timespec_get, would you prefer me to
create one or put the define in time/time.h?

>
> > > # 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.

Ah, you are right. I have added these defines.

Alistair

>
> --
> Joseph S. Myers
> joseph@codesourcery.com


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]