mknod

NAME

mknod - build special file

SYNOPSIS

mknod [-m mode] name [c | b] major minor
mknod [-m mode] name p

DESCRIPTION

The mknod(1) utility creates device special files. Normally the command /usr/sbin/makedev is used to create special files for commonly known devices; it executes mknod(2) with the appropriate arguments and can make all the files required for all standard devices supported by Interix.

You must be logged on as a member of the Administrators group to run mknod(1), otherwise the utility displays an error message and exits.

Interix recognizes the files created by mknod(1) as unique. Superficially identical files created through means other than mknod(1), mknod(2), and makedev(1) (for example, through backup and restore) will not be treated as device files by Interix, and attempts to open devices through such files with fail with the error code ENXIO.

The options are as follows:

-m mode
Set the file mode. The mode argument can be absolute or symbolic, as described in chmod(1). In symbolic strings, the plus sign (+) and dash (-) operators are interpreted relative to an assumed initial mode of a=rw.

The arguments are as follows:

b | c | p
Type of device or FIFO. If the device is a block type device such as a tape or disk drive which needs both cooked and raw special files, the type is b. All other devices are character type devices, such as terminal and pseudo devices, and are type c. A FIFO (also known as a named pipe) is type p.
major
The major device number is an integer number which tells the kernel which device driver entry point to use.
minor
The minor device number tells the kernel which subunit the node corresponds to on the device; for example, a subunit may be a file-system partition or a tty line.

Major and minor device numbers can be given in any format acceptable to strtoul(3), so that a leading 0x indicates a hexadecimal number, and a leading 0 will cause the number to be interpreted as octal.

SEE ALSO

makedev(1)

chmod(1)

mkfifo(1)

mkfifo(2)

mknod(2)