Content-type: text/html
eval `major_minor`; $major_number = &dev_major($devnum); $minor_number = &dev_minor($devnum);
For example, the FreeBSD 2.2 output is:
sub dev_major { local($dev) = @_; ($dev >> 8) & 0xff; };
sub dev_minor { local($dev) = @_; ($dev & 0xffff00ff); };
1;
In principle, this information could be obtained by parsing system include files, but a little C program is more robust.
A similar trick was used first with the SATAN program.
This software is distributed under the IBM Public License.
Wietse Venema IBM T.J. Watson Research P.O. Box 704 Yorktown Heights, NY 10598, USA