Subject: Re: Cups with parallel port
To: None <netbsd-users@netbsd.org>
From: Jeremy C. Reed <reed@reedmedia.net>
List: netbsd-users
Date: 10/03/2002 13:29:34
> > > The problem is that CUPS doesn`t show the parallel port in the list
> > > of available connections...
Okay, I added some debugging to cups-1.1.15/backend/parallel.c
$ ./parallel
here in NetBSD
trying /dev/lpt0
parallel: /dev/lpt0 (16): Device busy
trying /dev/lpa0
parallel: /dev/lpa0 (16): Device busy
trying /dev/lpt1
parallel: /dev/lpt1 (13): Permission denied
trying /dev/lpa1
parallel: /dev/lpa1 (13): Permission denied
trying /dev/lpt2
parallel: /dev/lpt2 (13): Permission denied
trying /dev/lpa2
parallel: /dev/lpa2 (13): Permission denied
It does open(device, O_WRONLY).
So the problem is error 16, "Device busy".
Sometimes, when I turn on or off the printer and run ./parallel at the
same time (within the one second), it successfully opens the /dev/lpt0 or
/dev/lpa0 (and no "Device busy).
Is "Device busy" a valid error for assuming that the parallel port is
never available for configuration for future printing?
Any comments or advice before I submit patch for pkgsrc and back to cups
developers?
(On a side note, open(2) manual doesn't mention "EBUSY".)
Jeremy C. Reed
http://www.reedmedia.net/