Poster of Linux kernelThe best gift for a Linux geek
MAJOR_MINOR

MAJOR_MINOR

Section: User Commands (1)
Local index Up
 

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


 

Index

NAME
SYNOPSIS
DESCRIPTION
HISTORY
LICENSE
AUTHOR(S)

This document was created by man2html, using the manual pages.
Time: 21:14:47 GMT, April 16, 2011