Commit Graph

8 Commits

Author SHA1 Message Date
Rich Felker ca9aff6a16 add NFDBITS in sys/select.h with appropriate feature tests
the main use for this macro seems to be knowing the correct allocation
granularity for dynamic-sized fd_set objects. such usage is
non-conforming and results in undefined behavior, but it is widespread
in applications.
2013-07-06 01:12:28 -04:00
Rich Felker 455f96857f remove all remaining redundant __restrict/__inline/_Noreturn defs 2012-09-08 17:14:52 -04:00
Rich Felker 400c5e5c83 use restrict everywhere it's required by c99 and/or posix 2008
to deal with the fact that the public headers may be used with pre-c99
compilers, __restrict is used in place of restrict, and defined
appropriately for any supported compiler. we also avoid the form
[restrict] since older versions of gcc rejected it due to a bug in the
original c99 standard, and instead use the form *restrict.
2012-09-06 22:44:55 -04:00
Rich Felker c41a76f58c FD_ISSET must return an int. this is the easiest way.
casting to int would not be correct because high bits could be lost.
mapping the high bits down onto low bits would be costlier in the
common case where the result is just used in a conditional. changing
the type of the bit array elements to int would permute the order of
the bit array on 64-bit big endian systems, so that's not an option
either.
2011-09-23 22:24:33 -04:00
Rich Felker 1f5ff26cd7 fix broken FD_* macros on 64-bit targets
1 is too small if int is 32-bit but unsigned long is 64-bit. be
explicit and use 1UL.
2011-08-27 19:42:13 -04:00
Rich Felker 33a3f202d1 add useless type fd_mask. it's in the reserved namespace. 2011-04-14 16:23:31 -04:00
Rich Felker cac7d837cc fix and cleanup suseconds_t/timeval stuff (broken on 64-bit)
trash in the upper 32 bits was making the kernel sleep forever in
select on 64-bit systems.
2011-04-13 13:16:49 -04:00
Rich Felker 0b44a0315b initial check-in, version 0.5.0 2011-02-12 00:22:29 -05:00