The reason I think it is ugly is that it isn't robust. It will cause the process to *hang* if started in such a way that other some other process competes for the stdin data. If the program reads stdin and a socket (say an X interface), I want to be able to interact with it through the socket even if something fishy happened to its stdin.
To me, this is a corner where unix is simply braindamaged, and there's no way to deal with it that I particularly like.
/ Niels Möller ()
Previous text:
2003-03-19 14:12: Subject: I/O callbacks in blocking mode
I don't think it's ugly to read in blocking mode using select. Even the examples in the manpage does it. Using stdin, actually.
/ Per Hedbor ()