Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 10 May 1996 01:00:49 +0200 (SAT)
From:      Robert Nordier <rnordier@iafrica.com>
To:        terry@lambert.org (Terry Lambert)
Cc:        hackers@freebsd.org
Subject:   Re: [Q] Raw interface to block devices
Message-ID:  <199605092300.BAA03101@eac.iafrica.com>
In-Reply-To: <199605092159.OAA29636@phaeton.artisoft.com> from "Terry Lambert" at May 9, 96 02:59:46 pm

next in thread | previous in thread | raw e-mail | index | archive | help
Terry Lambert wrote:

> > There must be a better way to do this.  The stuff I've looked at
> > either trustingly waits forever on '/dev/tty', or refuses to even
> > consider 'floppy'.
> > 
> > Surely a library function is needed (or already exists).
> 
> The typically used approach is to stat the device to get the major
> and minor number, then iterate all devices looking for the same
> major, but a minor that's the same + 128 for the raw device (or
> whatever the magic relationship happens to be on whatever system).

Thanks, I'll look at that.

> Note that all of this starts to fall apart under devfs usage, which
> wants device iteration by parent as a result of a stat reference
> returning non-terminal devices as directories that can be ioctl'ed
> to turn them into devices.  This lets you get iterate devices by
> class without stats or opens on the actual devices themselves.
> 
> I guess I need to reintegrate the devfs code on my local machine
> and work on putting together an API for this when I get a chance.
> 8-(.

I guess devfs benefits are beginning to sink in at last. 8)

I suppose things like FS utilities don't absolutely _need_
idiot-proofing.  But it'd be nice to have stuff working more
robustly.

--
Robert Nordier



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