[PATCH] Semaphores: add sem_timedwait_monotonic GNU extension [BZ #14717]

Jan Klötzke jan@kloetzke.net
Fri Dec 14 21:04:00 GMT 2018


On Thu, Dec 13, 2018 at 08:28:12PM +0000, Joseph Myers wrote:
> On Thu, 13 Dec 2018, Jan Klötzke wrote:
> 
> > The added sem_timedwait_monotonic() function behaves just like
> > sem_timedwait() but is based on CLOCK_MONOTONIC. An identically named
> > function is already provided by QNX for the same reasons.
> 
> My understanding from the Austin Group discussion was that the preferred 
> approach was functions with "clock" instead of "timed" in their names, 
> taking a clockid parameter (so sem_clockwait in this case).
> 
> http://austingroupbugs.net/view.php?id=1216

Oh, I wasn't aware of this proposal. Looks reasonable and even more
generic. I will send a v2 accordingly. I'm not sure if I find the time
to implement the other proposed functions but it looks worth it.

> Note that new functions need a NEWS entry.  They also need testcases; I 
> don't see any in this patch.

Will fix that with v2 too.

> How has this patch been tested?  I'd have expected it to fail the ABI 
> tests, because
> 
> > diff --git a/sysdeps/unix/sysv/linux/x86_64/64/libpthread.abilist b/sysdeps/unix/sysv/linux/x86_64/64/libpthread.abilist
> > index 931c8277a8..a69993f4d9 100644
> > --- a/sysdeps/unix/sysv/linux/x86_64/64/libpthread.abilist
> > +++ b/sysdeps/unix/sysv/linux/x86_64/64/libpthread.abilist
> > @@ -254,3 +254,4 @@ GLIBC_2.4 pthread_mutexattr_getrobust_np F
> >  GLIBC_2.4 pthread_mutexattr_setprioceiling F
> >  GLIBC_2.4 pthread_mutexattr_setprotocol F
> >  GLIBC_2.4 pthread_mutexattr_setrobust_np F
> > +GLIBC_2.29 sem_timedwait_monotonic F
> 
> (for example) is not placing the new entry in its correct (LC_ALL=C) 
> sorted location.

The cold and harsh truth is that I forgot to execute the tests. My bad.
I only tested it by running some manual tests with the new version.

> Are you covered by an FSF copyright assignment?

Not yet. Quite frankly I'm a bit lost what needs to be done exactly to
pass the legal part.

Regards,
Jan



More information about the Libc-alpha mailing list