Red Hat Bugzilla – Bug 113172
Definition for _POSIX_THREAD_PROCESS_SHARED missing ?
Last modified: 2007-11-30 17:07:00 EST
From Bugzilla Helper:
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 4.0;
Description of problem:
ES 3 supports Native POSIX Thread Library (NPTL). Thus
pthread_condattr_setpshared is supports. If this (optional) Posix
features are available and support shared processes
_POSIX_THREAD_PROCESS_SHARED should be defined after including
That's my knowlegde (This might be incorrect. Sorry if so.)
In any case _POSIX_THREAD_PROCESS_SHARED is not defined.
-) Is my knowlegde incorrect ?
-) Does I have to include some other *.h file (ptherad.h does not
defione it either, grep did not find a match) ?
-) Does ES 3 *NOT* support condition variables across processes ?
-) Or is the definition simply missing ?
Version-Release number of selected component (if applicable):
Steps to Reproduce:
1.Compile a source including <unistd.h>
2.Check presence using #ifdef ...
Actual Results: _POSIX_THREAD_PROCESS_SHARED is not defined
Expected Results: _POSIX_THREAD_PROCESS_SHARED should be defined
It looks like **I** make some mistake. I located alternate
includefiles at /usr/include/nptl.
In /usr/include/nptl/bits/posix_opt.h the desired #define is
included. But I could not detect (until now) how to correctly include
this file. I added -I /usr/include/nptl, but this does not work. I do
not like to directly include some file from deeper directories and I
think switching to ntpl must work withou editing sources (as long as
no documented changes are required). I do not expect editing sources
is required to get the correct includes.
Please could someone give me some advice - or a pointer to the
--------------- PLEASE CLOSE ----------------
There was a simple typo in the include string.
Adding -I/usr/include/nptl solves the problem.
So if there is no information to be added from Redhat's side,
this "bug" can be closed.
Sorry for the effort I caused at your site.
When you don't use -I/usr/include/nptl -L/usr/lib/nptl, the resulting
program will run with both NPTL and LinuxThreads. Because LT
doesn't support pshared primitives, _POSIX_THREAD_PROCESS_SHARED
is not defined on purpose.
If you build with -I/usr/include/nptl -L/usr/lib/nptl, ie. build
a NPTL only program, then it is defined.