NetBSD-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: sys/types.h header file Issue


2009/11/13 Thor Lancelot Simon <>:
> On Fri, Nov 13, 2009 at 06:00:01PM +0530, Channa wrote:
>> What is the reason for including <pthread_types.h> under the macros
>> or '_XOPEN_SOURCE' ?
>> Since the IEEE specification for <sys/types.h> below does not mention
>> such a rule
>> Is it ok to move the inclusion of <pthread_types.h> outside these macros?
> No, it is not.  The reason the inclusion is conditional on Posix/XOpen
> version is because the types declared in pthread_types.h constitute
> namespace pollution according to the older standard, which did not describe
> them.
> Are you trying to build something that sets POSIX_C_SOURCE to a very small
> value?

I have declared prototype of pthread_kill() in the <signal.h>
header file as per the IEEE specification of pthread_kill() link given

And the data type 'pthread_t' is exposed to <signal.h> through <sys/types.h>
which includes <pthread_types.h> with the following macros as given below:

$ cat src/sys/sys/types.h
#if (_POSIX_C_SOURCE - 0L) >= 199506L || (_XOPEN_SOURCE - 0) >= 500 || \
#include <pthread_types.h>

When i am building my application i get compilation error at
'pthread_t' data type
since the application does not define any of the macros '_POSIX_C_SOURCE'
or '_XOPEN_SOURCE' or '_NETBSD_SOURCE'. and the pthread data types
are not getting included in <signal.h> header file.

So to solve this build break in the application is it mandatory to define
any of the above said macros? or Modify the header file <sys/types.h> to
avoid such error?

Thanks & Regards,

Home | Main Index | Thread Index | Old Index