… | |
… | |
2727 | if (0 == setrlimit (RLIMIT_NOFILE, &rl)) |
2727 | if (0 == setrlimit (RLIMIT_NOFILE, &rl)) |
2728 | XSRETURN_YES; |
2728 | XSRETURN_YES; |
2729 | |
2729 | |
2730 | if (errno == EPERM) |
2730 | if (errno == EPERM) |
2731 | { |
2731 | { |
2732 | /* setlimit failed with EPERM - maybe we can't raise the hardlimit, or maybe */ |
2732 | /* setrlimit failed with EPERM - maybe we can't raise the hardlimit, or maybe */ |
2733 | /* our limit overflows a system-wide limit */ |
2733 | /* our limit overflows a system-wide limit */ |
2734 | /* try an adaptive algorithm, but do not lower the hardlimit */ |
2734 | /* try an adaptive algorithm, but do not lower the hardlimit */ |
2735 | rl.rlim_max = 0; |
2735 | rl.rlim_max = 0; |
2736 | for (bit = 0x40000000U; bit; bit >>= 1) |
2736 | for (bit = 0x40000000U; bit; bit >>= 1) |
2737 | { |
2737 | { |