This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH v3 2/6] nptl: Add POSIX-proposed sem_clockwait
- From: Florian Weimer <fweimer at redhat dot com>
- To: Mike Crowe <mac at mcrowe dot com>
- Cc: libc-alpha at sourceware dot org
- Date: Tue, 25 Jun 2019 20:06:53 +0200
- Subject: Re: [PATCH v3 2/6] nptl: Add POSIX-proposed sem_clockwait
- References: <cover.206947992e95511c1c56165c9aa98ae1a2296b75.1558987219.git-series.mac@mcrowe.com> <260b12640f1fa9ef3ce8f60830237d8885e3dc10.1558987219.git-series.mac@mcrowe.com> <bfc96808-93ef-4855-6c25-98a229e5a48f@linaro.org> <20190606154050.ocgpl7vefaxtmkfk@mcrowe.com>
* Mike Crowe:
> On Wednesday 05 June 2019 at 18:07:18 -0300, Adhemerval Zanella wrote:
>> On 27/05/2019 17:03, Mike Crowe wrote:
>> > Add:
>> >
>> > int sem_clockwait (sem_t *sem, clockid_t clock, const struct timespec *abstime)
>> >
>> > which behaves just like sem_timedwait, but measures abstime against the
>> > specified clock. Currently supports CLOCK_REALTIME and CLOCK_MONOTONIC and
>> > sets errno == EINVAL if any other clock is specified.
>>
>> For non-POSIX definition we will need to first export it as a GNU extension
>> with a possible non-reserved name and later, when it is included on the
>> standard, to add an alias to the expected name.
>>
>> The usual naming scheme is to append the _np suffix (non-portable) on
>> implementation, similar to recent posix_spawn file action extensions.
>> In this case it would be sem_clockwait_np.
> I thought we went through this before[1] and agreed that the _np suffix wasn't
> necessary in this case. However, I couldn't find a reply to Florian
> agreeing to that.
Upon second thought, I agree with Adhemerval here. We should use a
function with the _np suffix, otherwise we'll be in a world of pain if
something else is standardized.
Thanks,
Florian