This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [RFC v3 01/23] sysdeps/nanosleep: Use clock_nanosleep_time64 if avaliable
- From: Stepan Golosunov <stepan at golosunov dot pp dot ru>
- To: Alistair Francis <alistair23 at gmail dot com>
- Cc: Florian Weimer <fweimer at redhat dot com>, 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>, Palmer Dabbelt <palmer at sifive dot com>, macro at wdc dot com, Zong Li <zongbox at gmail dot com>
- Date: Sat, 20 Jul 2019 18:24:28 +0400
- Subject: Re: [RFC v3 01/23] sysdeps/nanosleep: Use clock_nanosleep_time64 if avaliable
- References: <cover.1563321715.git.alistair.francis@wdc.com> <e7c97afa751d0c3aef8061e9e54ea6d777f217bd.1563321715.git.alistair.francis@wdc.com> <87sgr5dywf.fsf@oldenburg2.str.redhat.com> <CAKmqyKPO=NpVVOYi3z1LL5ncftMYhZ=HujBSm1seChYEVXELow@mail.gmail.com>
19.07.2019 в 10:25:46 -0700 Alistair Francis написал:
> On Tue, Jul 16, 2019 at 10:16 PM Florian Weimer <fweimer@redhat.com> wrote:
> >
> > * Alistair Francis:
> >
> > > +#if __TIMESIZE == 32
> > > +struct timespec64
> > > +{
> > > + long int tv_sec; /* Seconds. */
> > > + long int tv_nsec; /* Nanoseconds. */
> > > +};
> > > +#endif
> > > +
> > > int
> > > thrd_sleep (const struct timespec* time_point, struct timespec* remaining)
> > > {
> > > INTERNAL_SYSCALL_DECL (err);
> > > - int ret = INTERNAL_SYSCALL_CANCEL (nanosleep, err, time_point, remaining);
> > > + int ret;
> > > +
> > > +#ifdef __ASSUME_TIME64_SYSCALLS
> > > + ret = INTERNAL_SYSCALL_CANCEL (clock_nanosleep_time64, err, CLOCK_REALTIME,
> > > + 0, time_point, remaining);
> > > +#else
> > > +# ifdef __NR_clock_nanosleep_time64
> > > +# if __TIMESIZE == 64
> > > + long int ret_64;
> > > +
> > > + ret_64 = INTERNAL_SYSCALL_CANCEL (clock_nanosleep_time64, err, CLOCK_REALTIME,
> > > + 0, time_point, remaining);
> > > +
> > > + if (ret_64 == 0 || errno != ENOSYS)
> > > + ret = ret_64;
> > > +# else
> > > + timespec64 ts;
> > > +
> > > + ret = INTERNAL_SYSCALL_CANCEL (clock_nanosleep_time64, err,
> > > + CLOCK_REALTIME, 0, time_point,
> > > + ts);
> > > +
> > > + if (ret == 0 || errno != ENOSYS) {
> > > + remaining->tv_sec = ts.tv_sec;
> > > + remaining->tv_nsec = ts.tv_nsec;
> > > + return ret;
> > > + }
> > > +# endif
> > > +# endif
> > > + ret = INTERNAL_SYSCALL_CANCEL (nanosleep, err, time_point, remaining);
> > > +#endif
> > > +
> >
> > I think this changes the ABI of thrd_sleep if
> > __NR_clock_nanosleep_time64 is defined (and __NR_nanosleep was defined
> > before).
>
> I'm not sure I understand, which part changes the ABI?
Parts where time_point (2 cases) and remaining (1 case) are passed to
the clock_nanosleep_time64 syscall while __TIMESIZE == 32.