MPE/iX System Utilities Reference Manual (32650-90882)
154 Chapter14
MKNOD
Operation
Operation
MKNOD determines how to create the files based on the arguments passed to the program.
When creating a device link or streams (character-type) file, you must enter both the major
and minor numbers. To create a device link file, enter a major number of 0 and the LDEV
number of the device as the minor number. To create a streams file, enter a major number
greater than 0.
Syntax
mknod "name c|p major minor [link_name]"
Parameters
name Creates a special or fifo file including the program name in the pathname.
c|p Creates a device link file or streams file if this argument is 'c' (character
type).
Creates a fifo file or pipe if this argument is 'p'.
major Major number. The following major numbers are valid:
0 Creates a device link. The minor number represents the
LDEV number.
1-254 Creates a streams file.
minor Minor device type. This is used in conjunction with the major number
option to provide a UNIX compatible device specification. The interpretion
of the minor number is dependent on the value of the major number. If the
major number is 0, then this number represents a LDEV number. If the
major number is > 0, then this number represents a streams connection to
a driver.
link_name Creates the streams file with a link_name. This name is an
eight-character MPE link_name (from the NMMGR link screen).
When the special file is created, it can be accessed through the HPFOPEN intrinsic and the C
library "open" interface. The 0_NONBLOCK option can be specified using open.
MKNOD sets a CI variable mknodvar with the value 0 if successful. If errors occur, it returns
the file system error status.
To create a fifo file called MYFIFO:
mknod "myfifo p"
To create a device link file for LDEV 7:
mknod "/dev/tape7 c,0,7"
To create a streams file with a link_name of DTSLINK, a major number of 1, and a minor
number of 10:
mknod "strmfile c,1,10,dtslink"