diff options
author | Roland McGrath <roland@gnu.org> | 2000-02-05 12:13:22 +0000 |
---|---|---|
committer | Roland McGrath <roland@gnu.org> | 2000-02-05 12:13:22 +0000 |
commit | 1a7ccb577c414677f9e763036d6ccce3a298f16d (patch) | |
tree | 10f45d0745e0f65108ecbda92ed6f7214dc703ff /pfinet/linux-src/include/linux/poll.h | |
parent | add1cad493c256d0a7c939070f9ee067c2718daf (diff) | |
parent | b39cd08347c72483a4521a55301a0fa147a2a2b1 (diff) |
Merge from vendor branch Linux:
Import of Linux 2.2.13 subset (ipv4 stack and related)
Diffstat (limited to 'pfinet/linux-src/include/linux/poll.h')
-rw-r--r-- | pfinet/linux-src/include/linux/poll.h | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/pfinet/linux-src/include/linux/poll.h b/pfinet/linux-src/include/linux/poll.h index 972c0cb0..7eb57334 100644 --- a/pfinet/linux-src/include/linux/poll.h +++ b/pfinet/linux-src/include/linux/poll.h @@ -59,6 +59,9 @@ typedef struct { unsigned long *res_in, *res_out, *res_ex; } fd_set_bits; +/* + * How many longwords for "nr" bits? + */ #define FDS_BITPERLONG (8*sizeof(long)) #define FDS_LONGS(nr) (((nr)+FDS_BITPERLONG-1)/FDS_BITPERLONG) #define FDS_BYTES(nr) (FDS_LONGS(nr)*sizeof(long)) @@ -87,17 +90,14 @@ int get_fd_set(unsigned long nr, void *ufdset, unsigned long *fdset) static inline void set_fd_set(unsigned long nr, void *ufdset, unsigned long *fdset) { - if (ufdset) { - nr = FDS_BYTES(nr); - __copy_to_user(ufdset, fdset, nr); - } + if (ufdset) + __copy_to_user(ufdset, fdset, FDS_BYTES(nr)); } static inline void zero_fd_set(unsigned long nr, unsigned long *fdset) { - nr = FDS_BYTES(nr); - memset(fdset, 0, nr); + memset(fdset, 0, FDS_BYTES(nr)); } extern int do_select(int n, fd_set_bits *fds, long *timeout); |