Directory in /dev

M. Warner Losh imp at bsdimp.com
Fri Nov 24 12:59:45 UTC 2006


In message: <20061124.055337.-432838076.imp at bsdimp.com>
            "M. Warner Losh" <imp at bsdimp.com> writes:
: In message: <200611241225.07481.marc.loerner at hob.de>
:             Marc Lörner <marc.loerner at hob.de> writes:
: : Hello,
: : is it possible to create/make a subdirectory under /dev,
: : or is it generally forbidden to do that?
: : 
: : I found nothing by googling or reading the archives of the freebsd mailing 
: : lists. I even found nothing by slightly looking into the kernel code.
: : 
: : Does anyone have some suggestions or pointers for me?
: 
: makedev in your driver with a slash:
: 
: make_dev(cdevsw, minor, uid, gid, perm, "fred/ford%d", unit);
: 
: or if you are creating a disk device, set the d_name similarly.

I should have added that creating the first device in a subdirectory
automatically creates that subdirectory.  Removing the last device
automatically deletes that subdirectory.  You can't create a
subdirectory just because you want it there, however.

Warner



More information about the freebsd-drivers mailing list