mknod(1M)
NAME
mknod − create special files
SYNOPSIS
/etc/mknod name c major minor [cnode_name]
/etc/mknod name b major minor [cnode_name]
/etc/mknod name p
DESCRIPTION
mknod creates the following types of files:
• Character device special file (first SYNOPSIS form),
• Block device special file (second SYNOPSIS form),
• FIFO file, sometimes called a named pipe (third SYNOPSIS form).
name is the path name of the file to be created. The newly created file has a default mode readable and writable by all users (066), but the mode is modified by the current setting of the user’s file mode creation mask (see umask(1)).
Character and Block Special Files
Character device special files are used for devices that can transfer single bytes at a time, such as nine-track magnetic tape drives, printers, plotters, disk drives operating in “raw” mode, and terminals. To create a character special file, use c as the second argument to the mknod command.
Block device special files are used for devices that usually transfer a block of data at a time, such as disk drives. To create a block device special file, use b as the second argument to mknod.
The remaining arguments specify the device that will be accessible through the new special file:
major This “major number” specifies the major device type (for example, the device driver number)
minor This “minor number” specifies the device location (typically, but not always, the unit, drive, HP-IB bus address and/or line number).
cnode_name If present, cnode_name specifies the cnode name, or if it is numeric, the cnode ID (see glossary(9)) from which the device special file can be accessed. For non-numeric cnode names, the file /etc/clusterconf is searched to determine the corresponding cnode ID.
The major and minor values can each be specified in hexadecimal, octal, or decimal, using C language conventions (decimal: no leading zero, octal: leading zero, hexadecimal: leading 0x).
Assignment of major and minor device numbers is specific to each HP-UX system. Refer to the System Administrator manuals supplied with your system for details.
Only users who have appropriate privileges can use mknod to create a character or block device special file.
FIFO files
To create a FIFO (named pipe or buffer) file, use p as the second argument to mknod (the mkfifo command can also be used for this purpose — see mkfifo(1)). All users can use mknod to create FIFO files.
Access Control Lists (ACLs)
Optional ACL entries can be added to special files and FIFOs with chacl(1). However, system programs are likely to silently change or eliminate the optional ACL entries for these files.
WARNINGS
Access Control Lists
Access control list descriptions in this entry apply only to standard HP-UX operating systems. If HP MACS software has been installed, access control lists are handled differently. Refer to HP MACS documentation for information about access control lists in the HP MACS environment.
FILES
/etc/clusterconf For translating cnode names to cnode IDs
SEE ALSO
chacl(1), mkdir(1), mkfifo(1), umask(1), lsdev(1M), mkdev(1M), sam(1M), mknod(2), acl(5), mknod(5).
HP-UX System Administrator manuals.
STANDARDS CONFORMANCE
mknod: SVID2, XPG2
Hewlett-Packard Company — HP-UX Release 9.0: August 1992