Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 15 May 2001 01:38:25 -0700
From:      Peter Wemm <peter@wemm.org>
To:        Poul-Henning Kamp <phk@critter.freebsd.dk>
Cc:        Brian Somers <brian@Awfulhak.org>, cvs-committers@FreeBSD.org, cvs-all@FreeBSD.org
Subject:   Re: cvs commit: src/sys/fs/devfs devfs_vnops.c 
Message-ID:  <20010515083825.1339C380E@overcee.netplex.com.au>
In-Reply-To: <30165.989915130@critter> 

next in thread | previous in thread | raw e-mail | index | archive | help
Poul-Henning Kamp wrote:
> In message <200105150007.f4F077515172@hak.lan.Awfulhak.org>, Brian Somers wri
    te
> s:
> >> phk         2001/05/14 01:20:47 PDT
> >> 
> >>   Modified files:
> >>     sys/fs/devfs         devfs_vnops.c 
> >>   Log:
> >>   After a successfull poll of the cloning functions, match on the
> >>   returned dev_t rather than the original name.
> >>   
> >>   This allows cloning from one name to another which is useful for
> >>   /dev/tty and later for the pty's.
> >>   
> >>   Revision  Changes    Path
> >>   1.23      +7 -15     src/sys/fs/devfs/devfs_vnops.c
> >
> >Does this mean that I can catch ``open("/dev/tun")'' and clone (say) 
> >/dev/tun100, returning that ?
> 
> yes :-)
> 
> We need a generic ioctl which returns the name of the device, so that
> we don't have weeds doing that by examining minor numbers popping up
> all over the place, but otherwise: have at it :-)

See libc:devname()

char *
devname(dev, type)
{
	static char buf[SPECNAMELEN + 1];
	...
	j = sizeof(buf);
	i = sysctlbyname("kern.devname", buf, &j, &dev, sizeof (dev));
	if (i == 0)
		return buf;
}

ie: it already exists, and I think you even were the one to write it..

Cheers,
-Peter
--
Peter Wemm - peter@FreeBSD.org; peter@yahoo-inc.com; peter@netplex.com.au
"All of this is for nothing if we don't go to the stars" - JMS/B5


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe cvs-all" in the body of the message




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