Messages in this thread | ![/](/images/icornerl.gif) | | Date | Sun, 13 Jul 2003 15:31:54 -0700 | From | Andrew Burgess <> | Subject | /proc/sys/fs/file-max broken in 2.4.22-pre5 |
| |
Setting /proc/sys/fs/file-max to 60000 results in a max of 1024 file handles. In 2.4.21-rc7-ac1 and random earlier kernels this works as expected.
---------------------------------------------------------------------------
root@athlon:/root # cat file-max.c #include <sys/time.h> #include <sys/resource.h> #include <unistd.h>
main() { int i = 0; struct rlimit r; getrlimit(RLIMIT_NOFILE, &r); r.rlim_cur = 50000; setrlimit(RLIMIT_NOFILE, &r); while(1) { if(fopen("/tmp/file-max-test", "w") == 0) { perror(""); break; } i++; } printf("opened %d files\n", i); }
root@athlon:/root # echo 60000 > /proc/sys/fs/file-max root@athlon:/root # cc file-max.c root@athlon:/root # a.out Too many open files opened 1021 files root@athlon:/root # uname -a Linux athlon 2.4.22-pre5 #2 SMP Sun Jul 13 12:38:04 PDT 2003 i686 unknown
- 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/
| ![\](/images/icornerr.gif) |