number of simultanously opened files

Divacky Roman xdivac02 at stud.fit.vutbr.cz
Sun Aug 21 09:48:53 GMT 2005


hi

I wrote this:
witten /tmp# cat x.c
#include <stdio.h>
#include <fcntl.h>
#include <sys/limits.h>

#define MAX     100000
main()
{
      int i = MAX;

         for (; i>0; i--) {
	          if (open("/dev/null", O_RDONLY) == -1) {
		              printf("FUCK: %i\n", MAX-i);
			      printf("FUCK: %i\n", i);
			      break;
		}
	}
getchar();
}

set:

witten ~# sysctl kern.maxfiles=100000
kern.maxfiles: 100000 -> 100000
witten ~# sysctl kern.maxfilesperproc=100000
kern.maxfilesperproc: 100000 -> 100000
witten ~#

but I still cannot open more than 7319 files simultaneously. pls can you tell
me why?

thnx 

roman


More information about the freebsd-hackers mailing list