This is the mail archive of the newlib@sourceware.org mailing list for the newlib project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] FreeBSD compatibility for <sys/select.h>


On Dec 18 08:02, Sebastian Huber wrote:
> On 17/12/15 22:46, Corinna Vinschen wrote:
> >On Dec 15 13:41, Corinna Vinschen wrote:
> >>>On Dec 15 11:45, Sebastian Huber wrote:
> >>>> >On 14/12/15 15:42, Corinna Vinschen wrote:
> >>>>> > >On Dec 14 10:06, Sebastian Huber wrote:
> >>>>>>> > >>>	* libc/include/sys/_sigset.h: New.
> >>>>>>> > >>>	* libc/include/sys/select.h: Do not include <sys/types.h> and
> >>>>>>> > >>>	<sys/time.h> to avoid cyclic header file dependencies.  Include
> >>>>>>> > >>>	specialized header files instead.
> >>>>>>> > >>>	(sigset_t): Conditionally define.
> >>>>>>> > >>>	* libc/include/sys/signal.h (sigset_t): Likewise.
> >>>>>>> > >>>	* libc/include/sys/time.h: Include <sys/select.h> if
> >>>>>>> > >>>	__BSD_VISIBLE.
> >>>>>>> > >>>	* libc/include/sys/types.h: Likewise.
> >>>>> > >Patch applied with changes for Cygwin.  I dropped the definition of
> >>>>> > >sigset_t in Cygwin's cygwin/signal.h in favor of the one from the
> >>>>> > >new sys/_sigset.h, so we can remove a few Cygwin test macros.
> >>>> >
> >>>> >Thanks, the <sys/select.h> of Newlib works now fine for RTEMS with the old
> >>>> >and new network stack.
> >>>
> >>>Cool.
> >I reverted the inclusion of sys/select.h in sys/types.h.  I know it's
> >done on FreeBSD, but it's not done on NetBSD nor on Linux.  It's also
> >questionable from a POSIX POV.
> >
> >Given that sys/select.h was never included from sys/types.h before in
> >newlib, there's no code relying on this yet.  OTOH it potentially breaks
> >backward compatibility and in an existing case it actually breaks
> >building Gnulib on Cygwin.
> >
> >Hope that's ok.  If not we can discuss this further next year.
> 
> It seems to work with this change. I guess this is due to the include of
> <sys/select.h> in <sys/time.h>. Is this all right?

Including sys/select.h from sys/time.h is perfectly fine.  We already did
that before, albeit only on Cygwin so far.  GLibc does it as well, even
unconditionally (no guard along our #if __BSD_VISIBLE).  Only sys/types.h
should not (must not per POSIX) expose the sys/select.h namespace.


Corinna

-- 
Corinna Vinschen
Cygwin Maintainer
Red Hat

Attachment: pgpUKGXIIYiqh.pgp
Description: PGP signature


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]