| 555 | |
| 556 | |
| 557 | int get_open_fds_limit(void) |
| 558 | { |
| 559 | struct rlimit rl; |
| 560 | int open_max; |
| 561 | if (open_files_limit > 0) |
| 562 | return open_files_limit; |
| 563 | if (getrlimit(RLIMIT_NOFILE, &rl) < 0) { |
| 564 | open_max = sysconf(_SC_OPEN_MAX); |
| 565 | return (open_max < 0?_POSIX_OPEN_MAX:open_max); |
| 566 | } |
| 567 | return rl.rlim_cur; |
| 568 | } |
| 569 | |
| 570 | void close_open_fds(void) |
| 571 | { |
no outgoing calls
no test coverage detected