Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 1 Jun 2016 19:22:38 +0300
From:      Konstantin Belousov <kostikbel@gmail.com>
To:        Ed Schouten <ed@nuxi.nl>
Cc:        Bruce Evans <brde@optusnet.com.au>, Ed Schouten <ed@freebsd.org>, src-committers <src-committers@freebsd.org>, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   Re: svn commit: r301071 - head/sys/sys
Message-ID:  <20160601162238.GM38613@kib.kiev.ua>
In-Reply-To: <CABh_MKkXH-F4LepiVnmMptHOCbC=OH8FDvia8Zv-0mHUYrnbtA@mail.gmail.com>
References:  <201605311905.u4VJ5geL053766@repo.freebsd.org> <20160601183101.X1028@besplex.bde.org> <CABh_MKkXH-F4LepiVnmMptHOCbC=OH8FDvia8Zv-0mHUYrnbtA@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
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@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.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20160601162238.GM38613>