svn commit: r301071 - head/sys/sys

Ed Schouten ed at nuxi.nl
Wed Jun 1 15:44:48 UTC 2016


Hi Bruce,

2016-06-01 11:31 GMT+02:00 Bruce Evans <brde at optusnet.com.au>:
>>  - This header file has always depended on pthread_t, pthread_attr_t,
>>    struct timespec, size_t and uid_t. Only as of POSIX 2008, these
>>    dependencies have been states explicitly. They should now be defined.
>
> Not always.  POSIX didn't have pthreads or timespecs before about 1993.

Sure. s/always/for a long time/

>>  - In our implementation, struct sigevent::sigev_notify_attributes has
>>    type "void *" instead of "pthread_attr_t *". My guess is that this was
>>    done to prevent pulling in the pthread types, but this can easily be
>>    avoided by using the underlying structure types.
>
> Not easily, since the tags of the underlying struct types are in the
> application namespace, at least up to POSIX 2001.

Yeah, it's quite unfortunate that we use structure types starting with
'pthread'. They should have had leading underscores. But in my opinion
that's not a problem specific to this change; it's a problem with our
pthread implementation in general.

>> +#include <sys/_pthreadtypes.h>
>
> This gives the following pollution (which breaks almost everything since
> <sys/types.h> includes this header:
> - struct tag names pthread*
> - struct member names state and mutex

Yes. It would have made so much more sense if a header like
<sys/_types.h> would have defined all pthread types as __pthread_t,
__pthread_mutex_t, etc. That way there would have been a way to expose
just pthread_t and pthread_attr_t without pulling in the rest.

-- 
Ed Schouten <ed at nuxi.nl>
Nuxi, 's-Hertogenbosch, the Netherlands
KvK-nr.: 62051717


More information about the svn-src-head mailing list