Re: parport patch / lp_readback

Martin Buck (Martin-2.Buck@student.uni-ulm.de)
Tue, 22 Apr 97 02:14 MET DST


Carsten Gross (carsten@sol.wohnheim.uni-ulm.de) 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

-- 
/* Martin Buck                      E-Mail: martin-2.buck@student.uni-ulm.de */
/* Student of electrical engineering   WWW: http://www.uni-ulm.de/~s_mbuck1/ */
/* University of Ulm, Germany  Snail-Mail: Paukengasse 2, 89077 Ulm, Germany */
#include <disclaimer.h>            /* PGP Key available    MIME-Mail welcome */