Red Hat Bugzilla – Bug 178997
PTHREAD_PRIO_INHERIT and friends missing from pthread.h
Last modified: 2007-11-30 17:11:22 EST
Description of problem:
Various #define and other symbols missing from pthread.h file (e.g.
PTHREAD_PRIO_INHERIT, pthread_mutexattr_setprotocol etc.)
Version-Release number of selected component (if applicable):
Steps to Reproduce:
1. Compile APR 1.2.2.
2. Wait for it to break on missing stuff.
locks/unix/proc_mutex.c:338: warning: implicit declaration of function
locks/unix/proc_mutex.c:338: error: 'PTHREAD_PRIO_INHERIT' undeclared
(first use in this function)
This used to work (i.e. APR compilation didn't fail before).
The APR currently in Rawhide was delivered on 05 Jan 2006. This glibc-headers
was delivered in Jan 10 2006. So, there is a good chance this problem wasn't yet
encountered in Rawhide APR build.
That's apr bug, it mistakenly assumes that if robust mutexes are available, then
POSIX priority inheritance extension is present as well, but that assumption
is valid on Solaris, but not on Linux.
Apr should just use the proper POSIXy way how to find out if priority inheritance
/* No support for priority inheritance or protection so far. */
#define _POSIX_THREAD_PRIO_INHERIT -1
#define _POSIX_THREAD_PRIO_PROTECT -1
which means the support is not present and the functions nor constants don't
need to be provided in the headers.
*** This bug has been marked as a duplicate of 176911 ***
That is not an APR bug as stated by Jakub Jelinek.
It is a misinterpretation by Linux of what the proper POSIXy way to do things is.
These 2 symbols are POSIX feature test macros, not limit macros.
They are either defined (to any value, including -1) if the feature is supported,
or not defined if the feature is not supported. See for example section 2.9.3
page 53 in Std 1003.1 1996 edition of POSIX.
In any case, Linux must have added these definitions, because it used to work.