DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH PRINT BOOK
 

makedev(S)


makedev, major, minor -- manage a device number

Synopsis

   #include <sys/types.h>
   #include <sys/mkdev.h>
   

dev_t makedev(major_t maj, minor_t min);

major_t major(dev_t device);

minor_t minor(dev_t device);

Description

The makedev routine returns a formatted device number on success and NODEV on failure. maj is the major number. min is the minor number. makedev can be used to create a device number for input to mknod(S).

The major routine returns the major number component from device.

The minor routine returns the minor number component from device.

Return values

On failure, NODEV is returned and errno is set to indicate the error.

makedev will fail if one or more of the following are true:


EINVAL
One or both of the arguments maj and min is too large.

EINVAL
The device number created from maj and min is NODEV.

major will fail if one or more of the following are true:


EINVAL
The device argument is NODEV.

EINVAL
The major number component of device is too large.

minor will fail if the following is true:


EINVAL
The device argument is NODEV.

References

mknod(S), stat(S)
© 2005 The SCO Group, Inc. All rights reserved.
SCO OpenServer Release 6.0.0 - 01 June 2005