… | |
… | |
2736 | for (bit = 0x40000000U; bit; bit >>= 1) |
2736 | for (bit = 0x40000000U; bit; bit >>= 1) |
2737 | { |
2737 | { |
2738 | rl.rlim_max |= bit; |
2738 | rl.rlim_max |= bit; |
2739 | rl.rlim_cur = rl.rlim_max; |
2739 | rl.rlim_cur = rl.rlim_max; |
2740 | |
2740 | |
2741 | /* nevr decrease the hard limit */ |
2741 | /* never decrease the hard limit */ |
2742 | if (rl.rlim_max < orig_rlim_max) |
2742 | if (rl.rlim_max < orig_rlim_max) |
2743 | break; |
2743 | break; |
2744 | |
2744 | |
2745 | if (0 != setrlimit (RLIMIT_NOFILE, &rl)) |
2745 | if (0 != setrlimit (RLIMIT_NOFILE, &rl)) |
2746 | rl.rlim_max &= ~bit; /* too high, remove bit again */ |
2746 | rl.rlim_max &= ~bit; /* too high, remove bit again */ |