On Thursday 08 March 2007 18:28, Linus Torvalds wrote:
Wait a second here... O_NONBLOCK is not just unnecessary - it's buggy!
Try to do nonblocking read from stdin (fd #0) -
* setting O_NONBLOCK with fcntl will set it for all other processes
which has the same stdin!
* trying to reset O_NONBLOCK after the read doesn't help (think kill -9)
* duping fd #0 doesn't help because O_NONBLOCK is not per-fd,
it's shared just like filepos.
I really like that trick with recvmsg + MSG_DONTWAIT instead.
--
vda
-