tech-kern archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: maj, min from device name



On Sun, 30 Aug 2009 20:51:01 +0200
Jan Danielsson <jan.m.danielsson%gmail.com@localhost> wrote:

> Hello,
> 
>    How does one convert a device string (for instance "cgd0a",
> "cgd1d") to/from a dev_t?
> 
>    For wd*, finddevice() (found in sys/kern/kern_subr.c) can be used
> -- but it appears that cgd* aren't listed in alldevs, so it returns
> NULL.
> 
Build the string "/dev/<devicename>" and pass it to stat(2).


                --Steve Bellovin, http://www.cs.columbia.edu/~smb


Home | Main Index | Thread Index | Old Index