svn commit: r198714 - head/sbin/mknod

Ed Schouten ed at 80386.nl
Sat Oct 31 19:05:26 UTC 2009


* Ed Schouten <ed at 80386.nl> wrote:
> It's a bit more complex than that. Right now devices are automatically
> numbered, using a 32-bits integer. The following macros are used to
> obtain the minor and major numbers (see <sys/types.h>):
> 
> | #define major(x)	((int)(((u_int)(x) >> 8)&0xff))	/* major number */
> | #define minor(x)	((int)((x)&0xffff00ff))		/* minor number */
> 
> This means that a device number above 255 may (or may not) have a
> non-zero major number. Just run the following code:

That said, I really couldn't care less if we eventually just nuked the
entire major/minor number distinction and let applications just print
the dev_t directly. This means `ls -l' would just print a single number.
POSIX doesn't standardize major/minor numbers anyway. Just the dev_t.

Unfortunately I do realize this probably breaks a lot of high profile
software.

-- 
 Ed Schouten <ed at 80386.nl>
 WWW: http://80386.nl/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 196 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/svn-src-all/attachments/20091031/09e04f81/attachment.pgp


More information about the svn-src-all mailing list