3 ms·
Returning immediately when nfds==0 is silly: this behavior would introduce a needless discontinuity in the API and requires special-case code in all callers, an
by quotemstr 10y ago
Returning immediately when nfds==0 is silly: this behavior would introduce a needless discontinuity in the API and requires special-case code in all callers, and all for no benefit. It's like those bad implementations of read_something functions that signal error in the case of reading zero bytes instead of more sanely just doing nothing successfully.
- JdeBP 10y agoIt's subtler than that. It's returning immediately when the number of file descriptors that it fails to add to a kqueue (that is actually going to do the work and that it is setting up) is the same as the total number of file descriptors passed, which it is when they are both zero.