[PATCH] sys/types.h: Avoid bit-manipulation of signed values

Corinna Vinschen vinschen@redhat.com
Tue Nov 17 18:01:00 GMT 2015


On Nov 17 08:17, Sebastian Huber wrote:
> 
> 
> On 16/11/15 12:55, Corinna Vinschen wrote:
> >On Nov 16 11:52, Sebastian Huber wrote:
> >>>On 14/11/15 10:55, Corinna Vinschen wrote:
> >>>> >On Nov 13 15:44, Sebastian Huber wrote:
> >>>>>> >>>On 13/11/15 10:53, Corinna Vinschen wrote:
> >>>>>>>> >>>> >RTEMS guys, any input on how you handle this stuff?  Do we have to stick
> >>>>>>>> >>>> >to sys/types.h or shall we carefully rearrange the definitions to be
> >>>>>>>> >>>> >better aligned with BSD, Linux, et al?
> >>>>>> >>>
> >>>>>> >>>It would be good to rearrange the definitions to be better aligned with BSD
> >>>>>> >>>and Linux. My long term goal is to get rid of the RTEMS-specific param.h
> >>>>>> >>>(newlib/libc/sys/rtems/include/sys/param.h).
> >>>> >Sounds good.  What about sys/select.h and the matching macros in
> >>>> >sys/types.h?
> >>>
> >>>Newlib has currently no sys/select.h. RTEMS provides its own copy of this
> >>>file. Do you plan to import a sys/select.h into Newlib and use it for
> >>>Cygwin?
> >Cygwin is using its own copy of sys/select.h.  I hacked a bit on this
> >and I came up with a sys/select.h which works for Cygwin and which might
> >be ok for inclusion into newlib.  See the attached patch.  I removed the
> >source patches required to make this work on Cygwin, so this patch only
> >shows what affects all targets.
> >
> >Note especially:
> >
> >- I moved NBBY to sys/param.h.
> >
> >- Define howmany in sys/param.h.
> >
> >In sys/select.h, as on FreeBSD:
> >
> >- Use "8" instead of "NBBY" (avoids dependency to sys/param.h).
> >
> >- Redefine fd_mask as unsigned long, rather than signed long.
> >
> >- Use _howmany instead of howmany.
> >
> >Please have a look if these changes would be ok for you.
> 
> Looks good. I need some time to use this in RTEMS, since I am currently busy
> with other stuff and this is only a nice to have.

That's ok, I'm pretty busy myself.  Can you ping back as soon as you
tested this?


Thanks,
Corinna

-- 
Corinna Vinschen
Cygwin Maintainer
Red Hat
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://sourceware.org/pipermail/newlib/attachments/20151117/5805240e/attachment.sig>


More information about the Newlib mailing list