Subject: Re: Obtaining different device behaviour
To: None <seifert@sequent.com>
From: Chris G Demetriou <Chris_G_Demetriou@UX2.SP.CS.CMU.EDU>
List: tech-kern
Date: 03/19/1996 19:04:10
> Another way for a user level program to signal to the kernel
> that it wants different behaviour from a device is to set a
> bit in the flags to the open(2) call. This seems cleaner to me
> than cluttering up /dev with ever expanding numbers of device
> entries. To my way of thinking, one physical device should have
> one entry in /dev. If you want the open to behave differently you
> pass a flag to open(2).
Excuse the sarcasm, but:
Great idea! It's _much_ better to have infinitely expanding numbers
of open arguments!
Solving this particular problems with device nodes is dumb, but if
that's true, then doing it with an open() flag is a large factor
dumber. (The 'large factor' is the number of meanings for spare
device node minor number bits than you can have if you use open
bits... and don't forget, different types of devices can use those
device number bits in different ways, _and_ one day NetBSD should
migrate to 32-bit devices, hopefully split 12/20.)
It seems to me that:
(1) this should be handled on a case-by-case basis, and
(2) since there's an obvious analogue in this case for
non-permanent settings (i.e. the ioctls used to set
current termios state), if the ability to set default
device parameters is desired then it would make the
most sense to use ioctls similar to the termios ones to
do it. That way, you could even make stty do the
right thing easily.
cgd