Date: Sat, 31 Oct 2009 20:05:25 +0100 From: Ed Schouten <ed@80386.nl> To: Christian Brueffer <brueffer@FreeBSD.org> Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r198714 - head/sbin/mknod Message-ID: <20091031190525.GF1293@hoeg.nl> In-Reply-To: <20091031185443.GE1293@hoeg.nl> References: <200910311222.n9VCMOGk089115@svn.freebsd.org> <20091031185443.GE1293@hoeg.nl>
next in thread | previous in thread | raw e-mail | index | archive | help
--YfqBrEkRVu0wMIYz Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable * Ed Schouten <ed@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>): >=20 > | #define major(x) ((int)(((u_int)(x) >> 8)&0xff)) /* major number */ > | #define minor(x) ((int)((x)&0xffff00ff)) /* minor number */ >=20 > 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. --=20 Ed Schouten <ed@80386.nl> WWW: http://80386.nl/ --YfqBrEkRVu0wMIYz Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (FreeBSD) iEYEARECAAYFAkrsinUACgkQ52SDGA2eCwXmAgCfZ/lLmeSjmhVTHTnlJjk7N50C CggAn0ciIHm47trl3f51TQHGIdX79PTF =6kfo -----END PGP SIGNATURE----- --YfqBrEkRVu0wMIYz--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20091031190525.GF1293>