Re: On re-working the major/minor system

H. Peter Anvin
2001-12-07T21:22:29Z

Followup to: <20011207135100.A17683@codepoet.org>
By author: Erik Andersen <andersen@codepoet.org>
In newsgroup: linux.dev.kernel
>
> Right. Tons of apps have illicit insider knowledge of kernel
> major/minor representation and NEED IT to do their job. Try
> running 'ls -l' on a device node. Wow, it prints out major and
> minor number. You can pack up a tarball containing all of /dev
> so tar has to has insider major/minor knowledge too -- as does
> the structure of every existant tarball! Check out, for example,
> Section 10.1.1 (page 210) of the IEEE Std. 1003.1b-1993 (POSIX)
> and you will see every tarball in existance stores 8 chars for
> the major, and 8 chars for the minor....
>

Actually, it's not "tons of apps", it's in the C library itself.

These things are defined in <sys/sysmacros.h> and anyone who uses
anything else should be taken out and shot.

-hpa
--
<hpa@transmeta.com> at work, <hpa@zytor.com> in private!
"Unix gives you enough rope to shoot yourself in the foot."
http://www.zytor.com/~hpa/puzzle.txt <amsp@zytor.com>