Ooops. We are chasing a red herring. As "Programming Perl 2ed"(166) explains:
fcntl will produce a fatal error if used on a machine that doesn't implement fcntl(2). On machines that do implement it, you can do such things as modify the close-on-exec flags, modify the non-blocking I/O flags, emulate the lockf(3) function...
In otherwords, you are SOL on Windows machines. Your best alternative is to loop on select with a very small timeout. The use of polling to achieve non-blocking is not-uncommon, but it is probably slower and more processor intensive (I don't really know.) So then you will want to implement this twice, once for when $^O eq 'MSWin32' and once for when it doesn't. | [reply] |