Bug 178997 - PTHREAD_PRIO_INHERIT and friends missing from pthread.h
Summary: PTHREAD_PRIO_INHERIT and friends missing from pthread.h
Keywords:
Status: CLOSED DUPLICATE of bug 176911
Alias: None
Product: Fedora
Classification: Fedora
Component: apr
Version: rawhide
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Joe Orton
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2006-01-26 11:17 UTC by Bojan Smojver
Modified: 2007-11-30 22:11 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2006-01-30 13:36:45 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Apache Bugzilla 38442 0 None None None Never

Description Bojan Smojver 2006-01-26 11:17:18 UTC
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):
2.3.90-30

How reproducible:
Always.

Steps to Reproduce:
1. Compile APR 1.2.2.
2. Wait for it to break on missing stuff.
  
Actual results:
-----------------------------
locks/unix/proc_mutex.c:338: warning: implicit declaration of function
'pthread_mutexattr_setprotocol'
locks/unix/proc_mutex.c:338: error: 'PTHREAD_PRIO_INHERIT' undeclared
(first use in this function)
-----------------------------


Expected results:
This used to work (i.e. APR compilation didn't fail before).


Additional info:
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.

Comment 1 Jakub Jelinek 2006-01-26 13:11:42 UTC
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
is supported.
Linux has:
/* 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.

Comment 2 Joe Orton 2006-01-30 13:36:45 UTC

*** This bug has been marked as a duplicate of 176911 ***

Comment 3 Bob Russell 2006-09-27 20:55:40 UTC
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.
Bob Russell


Note You need to log in before you can comment on or make changes to this bug.