Re: parport patch / lp_readback

Martin Buck (
Tue, 22 Apr 97 02:14 MET DST

Carsten Gross ( wrote:
> - Is "blocking IO" a good choice? This means a read from the device
> with no data available "hangs" (for example the simple 'cat').

This is the only useful solution if you want to write a daemon that sits in
the background and monitors the status of a printer (e.g. to display the
status panel that HP omitted on their newer printers on the screen).
Otherwise you'd have to use polling...

> If you add
> a 'fcntl(fildes, F_SETFL, O_NONBLOCK)' in an user program, a read from the
> device with no outstanding data returns EAGAIN. At the moment this is my
> choice and this is different to the old version.

Does select() work on the lp device? This would be a nice alternative to
nonblocking IO.


/* Martin Buck                      E-Mail: */
/* Student of electrical engineering   WWW: */
/* University of Ulm, Germany  Snail-Mail: Paukengasse 2, 89077 Ulm, Germany */
#include <disclaimer.h>            /* PGP Key available    MIME-Mail welcome */