This discussion is an illustration of why nonblocking I/O is itself inherently evil, and shouldn't even really exist. (It is just busy-wait polling, in disguise.)
If complex programs are instead coded in an event-driven manner, using AIO techniques, they can work with blocking (flow-control friendly, aka standard Unix streams) input and still work correctly, without ever disrupting simpler tools like pipeline components. These are pet peeves of mine, of the same sort that led to the creation of Plan 9. (Aka Unix cleaned up.) The O_NONBLOCK flag should only apply to open(2), if it even exists at all. Sockets should not exist as something distinct from regular file descriptors; netcat would only exist as functionality subsumed into dd. I have used a Unix-ey system (DNIX) that in fact worked this way, and supported a very nice networked GUI. It did have a robust and general asynchronous I/O mechanism, or else it would not have been possible. (Actually an asynchronous blocking operation mechanism, of which I/O was but one component. Other components were timers, and wait(2) calls.) I'm not sure which would be easier to do: simplify Unix down to its essentials eliminating a lot of bugs and bad design along the way, or balancing the US Federal budget. I think, however, that I will continue to breathe while I await these desirable things. -- Jim -----Original Message----- From: [email protected] [mailto:[email protected]] On Behalf Of Denys Vlasenko Sent: Wednesday, August 17, 2011 3:17 PM To: [email protected] Cc: Rich Felker Subject: Re: [PATCH] ash: clear NONBLOCK flag from stdin when in foreground On Wednesday 17 August 2011 23:20, Rich Felker wrote: > I hate it when fools who don't know what they're doing and don't > respect standards lobby for nonstandard behavior in Linux, thereby > making the portability landscape *worse* than it already it. Instead > try to understand why things are the way they are and just stop > insisting on doing stupid things (like setting nonblocking mode on a > fd you inherited). I already asked this question and you ignored it. So here it is again: How can I do nonblocking read from fd 0 without affecting other processes which might share it? _______________________________________________ busybox mailing list [email protected] http://lists.busybox.net/mailman/listinfo/busybox _______________________________________________ busybox mailing list [email protected] http://lists.busybox.net/mailman/listinfo/busybox
