From owner-freebsd-hackers Fri May 10 00:54:18 1996 Return-Path: owner-hackers Received: (from root@localhost) by freefall.freebsd.org (8.7.3/8.7.3) id AAA01156 for hackers-outgoing; Fri, 10 May 1996 00:54:18 -0700 (PDT) Received: from godzilla.zeta.org.au (godzilla.zeta.org.au [203.2.228.19]) by freefall.freebsd.org (8.7.3/8.7.3) with SMTP id AAA01140 for ; Fri, 10 May 1996 00:53:02 -0700 (PDT) Received: (from bde@localhost) by godzilla.zeta.org.au (8.6.12/8.6.9) id RAA02365; Fri, 10 May 1996 17:47:24 +1000 Date: Fri, 10 May 1996 17:47:24 +1000 From: Bruce Evans Message-Id: <199605100747.RAA02365@godzilla.zeta.org.au> To: bde@zeta.org.au, rnordier@iafrica.com Subject: Re: [Q] Raw interface to block devices Cc: hackers@FreeBSD.ORG Sender: owner-hackers@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk >> devname(3) seems to be almost what you want. You can stat the first name >> to get the dev number and then call devname() to get the other name. It >> searches quickly through all the names in /var/run/dev.db. >I've just tried that, and it seems to be _exactly_ what I want. :-) Actually, it is no help. It just does a fast search through /dev. It doesn't support going from the bdev to the cdev or vice versa. It can't support this because even the kernel barely knows the correspondence between bdevs and cdevs. In -current, the bdevsw and cdevsw entries contain pointers to each other. In -stable there is only the poorly maintained chrtoblk() routine. Bruce