Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 4 Mar 2004 18:42:28 +1100 (EST)
From:      Bruce Evans <bde@zeta.org.au>
To:        "Gary W. Swearingen" <underway@comcast.net>
Cc:        FreeBSD-gnats-submit@FreeBSD.org
Subject:   Re: bin/63718: lptcontrol.c has unused PATH_LPCTL definition.
Message-ID:  <20040304181246.T6033@gamplex.bde.org>
In-Reply-To: <61wu61h828.u61@mail.comcast.net>
References:  <61wu61h828.u61@mail.comcast.net>

next in thread | previous in thread | raw e-mail | index | archive | help

On Wed, 3 Mar 2004, Gary W. Swearingen wrote:

> >Description:
>
> lptcontrol.c has unused PATH_LPCTL definition.

Not using it is the bug.  From lptcontrol(4):

% ...
%      -d device
%              Set the mode of the printer device specified by device.  The
%              default value for device is /dev/lpt0.

The default should be the control device, but rev.1.7 of lptcontrol.c
broke this.  The data device a completely bogus default for the control
program.  Using it sometimes causes lptcontrol to hang or have undesirable
side effects.  You can work around this by specifying the control device
using -d and never using the default, but this shouldn't be necessary.

% FILES
%      /dev/lpt?               printer devices
%      /dev/lpctl?             printer control devices

The name of the control devices is documented here.  This is also
broken in -current.  The device name has 1 spelling error and 2 lexical
errors in devfs ("lpctl0" became "lpt0.ctl").

Both MAKEDEV and devfs are missing support for the all but 2 of the 64
mostly-undocumented subdevices per minor.  You can encode auto-linefeed
and 5 other attributes in the minor number.  One of the attributes is
LP_BYPASS, whose comment says that it is to bypass printer-ready checks
but which actually encodes being a control device, so there are only 33
useful subdevices per minor (32 data ones and 1 control one).  devfs
only creates 2 of these.

Bruce



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20040304181246.T6033>