svn commit: r301071 - head/sys/sys

Konstantin Belousov kostikbel at gmail.com
Wed Jun 1 16:22:45 UTC 2016


On Wed, Jun 01, 2016 at 05:44:47PM +0200, Ed Schouten wrote:
> 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.
No, it wouldn't.

Replace the typedefs with the forward-struct names by the void *.
The only other change would be the libthr, where some casts might
be needed.

Use void * directly in signal.h if possible.


More information about the svn-src-all mailing list