Re: RFC: poll change

From: Tim Hockin (thockin@sun.com)
Date: Tue Aug 14 2001 - 18:53:43 EST


"David S. Miller" wrote:
 
> The standard also says that any pollfd with (fd < 0) is ignored. Holes are
> explicitly ALLOWED.
>
> Dude, it ignores negative fds, check fs/select.c:do_pollfd()

Right - we're running in circles.

The standard says negative fd's are ignored. We get that right. What we
are left with is an overly paranoid check against max_fds. This check
should go away. You should be able to pass in up to your rlimit fds, and
let negative ones (holes or tails) be ignored.

I'm attaching a patch :).

Am I still not making the problem clear?

-- 
Tim Hockin
Systems Software Engineer
Sun Microsystems, Cobalt Server Appliances
thockin@sun.com

Index: fs/select.c =================================================================== RCS file: /home/cvs/linux-2.4/fs/select.c,v retrieving revision 1.5 diff -u -r1.5 select.c --- fs/select.c 2001/07/09 23:10:25 1.5 +++ fs/select.c 2001/08/14 23:47:46 @@ -416,11 +416,8 @@ int nchunks, nleft; /* Do a sanity check on nfds ... */ - if (nfds > NR_OPEN) + if (nfds > current->rlim[RLIMIT_NOFILE].rlim_cur) return -EINVAL; - - if (nfds > current->files->max_fds) - nfds = current->files->max_fds; if (timeout) { /* Careful about overflow in the intermediate values */

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Wed Aug 15 2001 - 21:00:55 EST