Re: [PATCH] to 2.4.0-test4-pre6, alpha, osf_select & KFDS_NR (poll.h breakage)

From: Ivan Kokshaysky (ink@jurassic.park.msu.ru)
Date: Thu Jul 13 2000 - 16:12:06 EST


On Fri, Jul 14, 2000 at 01:09:04AM +1000, Andrew van der Stock wrote:
> +#define KFDS_64BLOCK ((PAGE_SIZE/(6*64))*64)
> +#define KFDS_NR (KFDS_64BLOCK*8 > NR_OPEN ? NR_OPEN : KFDS_64BLOCK*8)
> if (n < 0 || n > KFDS_NR)
> goto out_nofds;
> +#undef KFDS_64BLOCK
> +#undef KFDS_NR

OSF select(2) supports up to 64K open file descriptors per process,
so better fix should be

--- linux/arch/alpha/kernel/osf_sys.c.orig Wed Jul 12 13:26:32 2000
+++ linux/arch/alpha/kernel/osf_sys.c Fri Jul 14 00:59:27 2000
@@ -1078,7 +1078,7 @@
         }
 
         ret = -EINVAL;
- if (n < 0 || n > KFDS_NR)
+ if (n < 0 || n >= 64*1024)
                 goto out_nofds;
 
         /*

Ivan.

-
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/



This archive was generated by hypermail 2b29 : Sat Jul 15 2000 - 21:00:17 EST