Using less in environment without controlling tty
Rich Felker
dalias at aerifal.cx
Wed Jul 31 19:30:33 UTC 2013
On Tue, Jul 30, 2013 at 01:35:29AM +0200, Denys Vlasenko wrote:
> On Monday 29 July 2013 16:46, Harald Becker wrote:
> > Hi Denys !
> >
> > >> Why do we need nonblocking I/O in less?
> > >
> > >Because I don't want to wait 999 seconds in this case
> > >before keys start working:
> > >
> > >{ echo line1; sleep 999; echo line2; } | busybox less
> >
> > less is a program using more than one one concurrent input, a
> > candidate for select/poll.
>
> select/poll should still use nonblocking fds, it does not guarantee
> that read will succeed.
Per the standard, it does, unless there is another concurrent reader
to steal the input. Old Linux versions had a few bugs here, especially
the infamous UDP checksum bug, but nowadays there should be no such
concern.
Rich
More information about the busybox
mailing list