man major_minor (Commandes) - major_minor - PERL start engine

NAME

major_minor - PERL start engine

SYNOPSIS

eval `major_minor`;

$major_number = &dev_major($devnum);

$minor_number = &dev_minor($devnum);

DESCRIPTION

major_minor emits two PERL routines, dev_major() and dev_minor() that take a device number as returned by stat() and that break the number up into the device major and minor number, respectively.

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.

HISTORY

A similar trick was used first with the SATAN program.

LICENSE

This software is distributed under the IBM Public License.

AUTHOR(S)

Wietse Venema
IBM T.J. Watson Research
P.O. Box 704
Yorktown Heights, NY 10598, USA