Subject: Re: vnconfig is broken
To: Chris Ross <>
From: Bill Studenmund <>
List: current-users
Date: 05/11/2005 17:24:03
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Tue, May 10, 2005 at 03:18:38PM -0400, Chris Ross wrote:
> Denis Lagno wrote:
> >On Tue, May 10, 2005 at 08:50:51PM +0200, Manuel Bouyer scribed:
> >
> >>Make sure you don't have a file called vnd0 or vnd0d in the current=20
> >>directory.
> >
> >bingo!:)
> >
> >I'm going to use cgd atop vnd, and vnd0d in the current directory is fil=
> >with cgd parameters..
>   Now to ask the next question.  Is it sensible for vnconfig
> to look for a device in the cwd?  Why would one ever *want*
> this behavior?


vndconfig uses opendisk(3). This is a standard (for NetBSD) routine, so
that each utility that does something with disks doesn't have to know
about how we create partition names. The first thing that routine tries is
open(2) on the supplied file name. That covers the case of "/dev/vnd0c".=20
If that open(2) fails, opendisk(3) then tries different variations on the=
supplied name.

While opendisk(3)'s behavior surprises you in this context, it is far less=
surprising than the alternative, which would be to start cooking the path=
before trying to see if the given path works. Thus we could end up using a=
variation on the given name even when the given name works.

Take care,


Content-Type: application/pgp-signature
Content-Disposition: inline

Version: GnuPG v1.2.3 (NetBSD)