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 | b39cd08347c72483a4521a55301a0fa147a2a2b1 (patch) | |
tree | b2e07976bbfca079fa686ce436b8028cf180b4ae /pfinet/linux-src/include/linux/poll.h | |
parent | 9fd51e9b0ad33a89a83fdbbb66bd20d85f7893fb (diff) |
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); |