3 ms·
Passing NULL is treated like passing an empty fd set. If there are no file descriptors to check, then "none of the defined events have occurred on any selected
by groovy2shoes 10y ago
Passing NULL is treated like passing an empty fd set. If there are no file descriptors to check, then "none of the defined events have occurred on any selected file descriptor" is trivially true. The same would hold for non-empty fd set and no defined events, I'd imagine.
- Redoubts 10y agoYou could also say that all of the defined events occurred.
- groovy2shoes 10y agoFor the "no defined events" case, that logic is sound. I can't imagine it being particularly useful behavior, though.
- ankurdhama 10y agoIt is kind of tricky to define this situation formally. Much like if a statement says "Given a list of numbers" than does empty list denotes a list of numbers? There are arguments for both - yes it does and no it doesn't - but the only way to select any one argument over other without conflict depends on additional constraints in the definition like saying "Given a list of numbers where the minimum length of list is 1".
- groovy2shoes 10y agoIf it is an empty list of numbers, then sure, it denotes a list of numbers. Luckily, we have type systems that enable us to tell empty lists apart :)