Reputation: 2335
I recently wrote a program to figure out the max amount of file descriptors open per process.
It was essentially
int fd = creat("somefile.dat");
int count = 1;
while(1)
{
int s = dup(fd);
if (s == -1)
break;
count++;
}
printf("Max fd: %d", s);
Now how would I apply this same program but to find the the max fd amount system-wide instead of per process?
Upvotes: 1
Views: 1579
Reputation: 40
I have multiple ideas for solutions to this:
1 - Multiply the maximum # of processes allowed in MINIX by the max FDs per process
2 - Create a program that runs the above program multiple times
P.S. You must be in my ecs150 class aren't you?
Upvotes: 2