[PATCH] Remove OPEN_MAX check from poll() syscall.

From: Vadim Lobanov
Date: Fri Jul 07 2006 - 22:10:48 EST


Hi,

This patch removes the OPEN_MAX component of the 'nfds' validity check
within the poll() system call implementation. Although this change will
be visible to userspace, I'll quote Ulrich Drepper for the rationale
behind its validity:

<quote>
[The requirement that EINVAL must be returned if nfds is greater than
OPEN_MAX] must be treated the same way as the EMFILE error in open():
ignore the OPEN_MAX limit if ulimit says so. The question is what to do
if the ulimit < OPEN_MAX. POSIX does not require OPEN_MAX to be the
exact limit.

So, I think removing the OPEN_MAX comparison is the correct way to do
this here. If somebody wants strict POSIX compliance they have to set
ulimit -n to 256.
</quote>

Please apply.

Signed-off-by: Vadim Lobanov <vlobanov@xxxxxxxxxxxxx>

diff -Npru linux-2.6.18-rc1/fs/select.c linux-new/fs/select.c
--- linux-2.6.18-rc1/fs/select.c 2006-07-06 20:21:05.000000000 -0700
+++ linux-new/fs/select.c 2006-07-06 20:22:58.000000000 -0700
@@ -671,7 +671,7 @@ int do_sys_poll(struct pollfd __user *uf
fdt = files_fdtable(current->files);
max_fdset = fdt->max_fdset;
rcu_read_unlock();
- if (nfds > max_fdset && nfds > OPEN_MAX)
+ if (nfds > max_fdset)
return -EINVAL;

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