---
name: "major_minor"
section: "1"
platform: "linux"
package: "tct"
version: "1.19-1"
release: "Debian 6.0 (Squeeze)"
platforms: ["linux"]
url: "https://new.carta.tech/major_minor"
---

# major\_minor(1)

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
```
