in reply to How to test for reliable select()?
Is there "a better way" to judge whether select works without having to fork and without it costing (too much) runtime?
This is as much a question as a suggestion.
On an OS where select does work on pipes, if you create a pipe, write to the write handle and then immediately select on the read handle with a timeout, shouldn't you get the read handle's fileno returned immediately? On Windows, you get 0:
pipe $in, $out;; print $out 'fred';; $si = ''; vec $si, fileno( $in ), 1;; print select $si, undef, undef, 0.1;; 0 0.1
|
|---|