Limit exposing rwlock API on GNU/Linux. master
authorNIIBE Yutaka <gniibe@fsij.org>
Wed, 15 May 2019 00:43:38 +0000 (09:43 +0900)
committerNIIBE Yutaka <gniibe@fsij.org>
Wed, 15 May 2019 00:43:38 +0000 (09:43 +0900)
commit575573b5b63e147b1906240f192dbe37a26ca4b9
treecdeffff61c2f369d4213172fe7625b46aa89dabf
parent223e59f992f9ea63563a8ad070b2f56fb1bbd83b
Limit exposing rwlock API on GNU/Linux.

* configure.ac (INSERT_EXPOSE_RWLOCK_API): New.
* src/npth.h.in: Use INSERT_EXPOSE_RWLOCK_API.
* tests/Makefile.am (AM_CPPFLAGS): Remove _POSIX_C_SOURCE.

--

Npth has rwlock implementation and offers its API.  It uses Pthread's
rwlock API if available.

On GNU/Linux, Pthread's rwlock API is only exposed when using newer
POSIX API.  Because of this, we had -D_POSIX_C_SOURCE=200112L for our
test programs (for the case using c99 executable, where the API is not
exposed).

This suggests that using Npth requires newer POSIX API.  It's not the
case, actually.

The right solution here is to limit exposing nPth's rwlock API, when
older API is selected, just like Pthread's rwlock API.  Then, Npth can
be used for building program with older API.

Also, by removing -D_POSIX_C_SOURCE=200112L, it fixes build breakage
on Solaris 11.

GnuPG-bug-id: 4491
Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
configure.ac
src/npth.h.in
tests/Makefile.am