Diff Detail
- Lint
Lint Skipped - Unit
Tests Skipped
Event Timeline
A few years ago, a change was made to getdtablesize() so it is no longer equivalent to getrlimit(RLIMIT_NOFILE).rlim_cur: getdtablesize() reflects rctl(8), while getrlimit(RLIMIT_NOFILE) and sysconf(_SC_OPEN_MAX) do not. Therefore, it may be useful to use getdtablesize() if what is desired is as accurate a file descriptor limit as possible.
I don't think rlimits are supposed to change (after their initial setting) other than via setrlimit(), so it may not be possible to fix this.
sysconf(_SC_OPEN_MAX) could be follow rctl, although it is a POSIX violation if the value changes other than because of a setrlimit(RLIMIT_NOFILE) call.
A few years ago, a change was made to getdtablesize() so it is no longer equivalent to getrlimit(RLIMIT_NOFILE).
That said, as far as I can tell POSIX used to claim getdtablesize as a legacy interface equivalent to getrlimit(RLIMIT_NOFILE) and it's now gone entirely. So I'm not sure what we ought to do.