Пишу сервер, нужно число конекций больше 1024.
$ cat test.cpp
#include <stdio.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <unistd.h>
int main(int argc, char *argv[])
{
size_t count = 0;
for (;;)
{
int fh = open(argv[0], O_RDONLY);
if (fh == -1)
{
printf ("count = %u\n", count);
break;
}
count++;
}
return 0;
}
$ g++ test.cpp -o test
$ ./test
count = 1021
Как увеличить это число ??? Иными словами как программно сделать ulimit -n 2048 ???