Poll

LeqxLeqx via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Fri Dec 23 03:07:49 PST 2016


I've recently been attempting to detect whether or not stdin 
would block a read if I tried. I have attempted to use the 
/core/sys/posix/poll.d but that seems to be always returning '1' 
whether or not stdin has anything on it, whereas for the 
corresponding program written in C, it will return 1 only if 
there is something on stdin.

If anyone has any suggestions, they would be much appreciated. 
Really all I need is a way of checking if a stream / file will 
block if I read it.

Thanks


More information about the Digitalmars-d-learn mailing list