dev/c/fopen_too_many_files/fopen_too_many_files.c

18 lines
260 B
C

#include <stdio.h>
#include <stdlib.h>
int main(int argc, char *argv[])
{
int i;
for (i = 0; i < 65536; i++)
if (!fopen("fopen_too_many_files.c", "rb")) {
printf("ulimit = %d\n", i);
break;
}
printf("Hello, world!\n");
return EXIT_SUCCESS;
}