diff options
author | Ulrich Drepper <drepper@redhat.com> | 1998-10-27 10:27:11 +0000 |
---|---|---|
committer | Ulrich Drepper <drepper@redhat.com> | 1998-10-27 10:27:11 +0000 |
commit | 2898c3a51449ade24995c6711d27858218efbd4c (patch) | |
tree | c44d16df4bbdcf45e5780a61b8410a0459899d16 /bits | |
parent | Update. (diff) | |
download | glibc-2898c3a51449ade24995c6711d27858218efbd4c.tar.gz glibc-2898c3a51449ade24995c6711d27858218efbd4c.tar.bz2 glibc-2898c3a51449ade24995c6711d27858218efbd4c.zip |
Update.
1998-10-27 Ulrich Drepper <drepper@cygnus.com>
* sysdeps/i386/bits/select.h [!__USE_XOPEN]: Add special version
of __FD_* macros which use __fds_bits.
* sysdeps/generic/bits/select.h: Likewise.
Reported by Matt McLean <keys@yikes.com>.
Diffstat (limited to 'bits')
-rw-r--r-- | bits/select.h | 23 |
1 files changed, 18 insertions, 5 deletions
diff --git a/bits/select.h b/bits/select.h index 98f1002b01..f886aec210 100644 --- a/bits/select.h +++ b/bits/select.h @@ -23,13 +23,26 @@ /* We don't use `memset' because this would require a prototype and the array isn't too big. */ -#define __FD_ZERO(set) \ +#ifdef __USE_XOPEN +# define __FD_ZERO(s) \ do { \ unsigned int __i; \ - __fd_set *__arr = (set); \ + __fd_set *__arr = (s); \ for (__i = 0; __i < sizeof (__fd_set) / sizeof (__fd_mask); ++__i) \ __arr->fds_bits[__i] = '\0'; \ } while (0) -#define __FD_SET(d, set) ((set)->fds_bits[__FDELT(d)] |= __FDMASK(d)) -#define __FD_CLR(d, set) ((set)->fds_bits[__FDELT(d)] &= ~__FDMASK(d)) -#define __FD_ISSET(d, set) (((set)->fds_bits[__FDELT(d)] & __FDMASK(d)) != 0) +# define __FD_SET(d, s) ((s)->fds_bits[__FDELT(d)] |= __FDMASK(d)) +# define __FD_CLR(d, s) ((s)->fds_bits[__FDELT(d)] &= ~__FDMASK(d)) +# define __FD_ISSET(d, s) (((s)->fds_bits[__FDELT(d)] & __FDMASK(d)) != 0) +#else +# define __FD_ZERO(s) \ + do { \ + unsigned int __i; \ + __fd_set *__arr = (s); \ + for (__i = 0; __i < sizeof (__fd_set) / sizeof (__fd_mask); ++__i) \ + __arr->__fds_bits[__i] = '\0'; \ + } while (0) +# define __FD_SET(d, s) ((s)->__fds_bits[__FDELT(d)] |= __FDMASK(d)) +# define __FD_CLR(d, s) ((s)->__fds_bits[__FDELT(d)] &= ~__FDMASK(d)) +# define __FD_ISSET(d, s) (((s)->__fds_bits[__FDELT(d)] & __FDMASK(d)) != 0) +#endif |