MAKEDEV(3C) | Standard C Library Functions | MAKEDEV(3C) |
makedev, major, minor - manage a device number
#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);
The makedev() function returns a formatted device number on success and NODEV on failure. The maj argument is the major number. The min argument is the minor number. The makedev() function can be used to create a device number for input to mknod(2).
The major() function returns the major number component from device.
The minor() function returns the minor number component from device.
Upon successful completion, makedev() returns a formatted device number. Otherwise, NODEV is returned and errno is set to indicate the error.
The makedev() function will fail if:
EINVAL
The major() function will fail if:
EINVAL
The minor() function will fail if:
EINVAL
See attributes(7) for descriptions of the following attributes:
ATTRIBUTE TYPE | ATTRIBUTE VALUE |
MT-Level | MT-Safe |
December 29, 1996 | OmniOS |