Re: Locking of serial devices and devfs
On Fri, Jun 22, 2001 at 03:49:42PM +0200, Russell Coker wrote:
> On Thursday 21 June 2001 16:09, Wichert Akkerman wrote:
> > Previously Cyrille Chepelov wrote:
> > > ... until one uses a lean version of devfs, which doesn't have these
> > > numbers, but just uses the pathname instead. Why design for a fragile
> > > system ? Device names aren't going away.
> > Using just names you loose since a single device can show up as
> > multiple names.
> True. The current code is provably broken in the case of sym-links.
> /dev/modem is a very common sym-link. The current ppp code will create
> LCK..modem for opening /dev/modem and LCK..ttyS0 for opening /dev/ttyS0,
> if /dev/modem is a sym-link to /dev/ttyS0 then you're stuffed.
> We could have our locking programs de-reference sym-links before creating
> lock files, but that wouldn't work with hard links or multiple creations
> of nodes.
> For example inserting a PCMCIA modem will create /dev/ttyS3 as
> well as having devfs create /dev/tts/3...
What you want is not possible within just POSIX, you have to decide on a
policy and stick with that.
Or you need a kernel level interface to find out the unique kernel device
name for that device, if there is one. And that is highly system specific
and will only work for the most simplistic type of systems, where each
device node corresponds to a unique kernel entity.
This problem can't be attacked this way. It requires a policy decision, as
there is nop portable technical solution to cover all border cases.
`Rhubarb is no Egyptian god.' Debian http://www.debian.org email@example.com
Marcus Brinkmann GNU http://www.gnu.org firstname.lastname@example.org