diff -Nru linux-old/fs/select.c linux-new/fs/select.c
--- linux-old/fs/select.c	2002-10-23 20:54:39.000000000 -0400
+++ linux-new/fs/select.c	2002-10-23 22:01:10.000000000 -0400
@@ -417,7 +417,7 @@
 	int nchunks, nleft;
 
 	/* Do a sanity check on nfds ... */
-	if (nfds > NR_OPEN)
+	if (nfds > current->rlim[RLIMIT_NOFILE].rlim_cur)
 		return -EINVAL;
 
 	if (timeout) {
