[PATCH] ash: clear NONBLOCK flag from stdin when in foreground

Bernd Petrovitsch bernd at petrovitsch.priv.at
Fri Aug 19 09:36:43 UTC 2011


On Fre, 2011-08-19 at 06:55 +0200, Denys Vlasenko wrote:
> On Thursday 18 August 2011 07:34, Laurent Bercot wrote:
> > > It doesn't; it can't.  Hence my ranting.  A 100% safe
> > > 100% orthogonal, useful easy-to-use AIO mechanism should
> > > have been designed
> > 
> >  Would the hypothetical nonblock_read() and nonblock_write() system
> > calls suggested at http://cr.yp.to/unix/nonblock.html be a good
> > enough design, or do you think something more is needed ?
> 
> Yes. But this requires new syscalls. And we might need more flags
> (such as "don't generate SIGPIPE"), so the new syscalls should be

Hmm, am I the only one where one of the first lines in almost all
daemons ignores SIG_PIPE?

>     read2(fd, buf, len, flags)
>     write2(fd, buf, len, flags)
> 
> where flags is a bitfield with bits "don't block", "don't SIGPIPE",
> and at this point - BOOM - you are realizing we already have them! -
> 
>     recv(fd, buf, len, flags)
>     send(fd, buf, len, flags)
> 
> and even needed flags already exist too: MSG_DONTWAIT, MSG_NOSIGNAL.
> 
> That's why I propose we don't multiply syscalls, but extend existing
> socket I/O ops to work on non-sockets.

IMHO it cannot be more elegant.

	Bernd
-- 
Bernd Petrovitsch                  Email : bernd at petrovitsch.priv.at
                     LUGA : http://www.luga.at



More information about the busybox mailing list