RE: Poll Error

David Schwartz (davids@webmaster.com)
Tue, 30 Nov 1999 09:43:41 -0800


> > Linux has a bogus sanity check. The one-line add below should
> > fix it. The kernel should be comparing the number of poll entries
> > against your resource limit, not your current file table size.
>
> Umm, which one liner below? And which kernel?

The one line fix was to his program, not the kernel. The bug seems to
exists in every Linux kernel that supports poll.

The bogus sanity check is in fs/select.h:

err = -EINVAL;
if (nfds > current->files->max_fds)
goto out;

The current maximum number of file descriptors is irrelevant. It's not
unusual for a program to create a poll structure with as many entries as it
plans to use in the future and set the unused entries to fd=-1. This check
causes such programs to fail on Linux.

DS

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