Allow use on systems which return ENOSYS for sem_init.
authorWerner Koch <wk@gnupg.org>
Wed, 29 Oct 2014 11:25:20 +0000 (12:25 +0100)
committerWerner Koch <wk@gnupg.org>
Wed, 29 Oct 2014 11:25:20 +0000 (12:25 +0100)
commit510135a23bb92fa527541e7d81bf6f831db306a5
tree938e82c9f9b37bbc3b8cfbc395095eb39b9c3984
parentb8b68d50c6fe5b7787454351271542c344d80bd2
Allow use on systems which return ENOSYS for sem_init.

* src/npth.c: Include some more headers.
(sceptre_buffer): New.
(sceptre): Change to a pointer and init to sceptre_buffer.
(enter_npth, leave_npth): Adjust.
(try_sem_open): New.
(npth_init): Check for ENOSYS and use sem_open.
--

This is for example the case on OS X and some AIX versions Thanks to
Patrick Brunschwig for finding this problem and suggesting a solution.
src/npth.c