No nonblocking write to /dev/lp. Is this a bug?

Carsten Gross (carsten@sol.wohnheim.uni-ulm.de)
Sat, 22 Feb 1997 18:24:21 +0100 (MET)


Hi everyone...

I've written some small programs to configure a printer on the printer port
at bootup time. But unfortunality a write to the (non ready) printer blocks
even if the device is opened with O_NONBLOCK. Only inserting a ioctl with
option LPABORT in my program returns -ENOSPC on writes in errno if the
printer is not ready.

In my opinion a write to the lp-device should return -EAGAIN if the printer
is offline and O_NONBLOCK is set. If option O_NONBLOCK is not set the write
to the offline printer should block. Is this correct?

This sounds more portable than the ioctl stuff and looks much nicer. Oh,
this was on Linux-kernel version 2.1.26

Carsten

-- 
Carsten Gross		Internet: carsten@sol.wohnheim.uni-ulm.de
Wohnheim Heilmeyersteige:  Sebastian Kneipp Weg 6, 89075 Ulm