On Wed, Aug 17, 2011 at 3:00 PM, Alexey Fomenko <[email protected]> wrote: > Simple command line programs like cat or vi cat just stop working with > an error: "Resource temprorarily unavailable". Busybox does not clear the > NONBLOCK flag from stdin when it is in the foreground.
Which shell does that? > fcntl(2) says: > File status flags > Each open file description has certain associated status flags, > initialized by open(2) and possibly modified by fcntl(). Duplicated > file descriptors (made with dup(2), fcntl(F_DUPFD), fork(2), etc.) > refer to the same open file description, and thus share the same file > status flags. > > This means that the programs you start from the command line, inheriting the > shell's stdin/out/err can influence them, and by extension, influence all > further programs to be launched. Yes, this is a bug in Unix API. Nonblocking I/O should have been done more sanely. Socket I/O has MSG_DONTWAIT flag which is *per-syscall*, but ordinary read/write don't, and have to mess with file flags, Please, ping LKML and ask them whether Linux is going to fix this mess. (The more people nag developers about it, the higher are chances they'll do something). My proposal was to make recv/send work on ordinary file fd's too, and allow MSG_DONTWAIT flag to be used in this case. -- vda _______________________________________________ busybox mailing list [email protected] http://lists.busybox.net/mailman/listinfo/busybox
