Use this command to create a new character special file. Character
special files allow you to access devices and other sources of data by
defining device drivers and using the file system functions.
Requirements and Restrictions
- The parameters for this command are case-sensitive. You
must enter the parameters exactly as shown in the syntax
diagram.
- You can enter this command only in CRAS state or higher.
Format
- path
- is the path name of the new character special file.
- c
- indicates the special file is a character-oriented device.
- major
- is the major device number for the new character special file. The
major device number specifies the device driver that the file system is to use
for the character special file. Specify this parameter in the same way
as a C language integer constant in octal, hexadecimal, or decimal format as
follows:
- Any number that starts with 0 is octal; for example, 0765.
- Any number that starts with 0x is hexadecimal; for example,
0xFE.
- Any number that does not start with 0 or 0x is decimal; for example,
9876.
Major device numbers must be in the range 0-65535 (decimal),
0-0xFFFF (hexadecimal), or 0-0177777 (octal). Major device
numbers from 32768 (0x8000, 0100000) to 65535 (0xFFFF, 0177777) are reserved
for IBM use. Major device number 32768 (0x8000, 0100000) is reserved
for regular files and cannot be used for character special files.
- minor
- is the minor device number for the new character special file. The
minor device number provides information about the character special file to
the device driver. The minor device number is meaningful only to the
device driver that corresponds to the major device number. Specify this
parameter in the same way as the major parameter. Minor device
numbers must be in the range 0-65535 (decimal), 0-0xFFFF
(hexadecimal), or 0-0177777 (octal).
Additional Information
- Online help information is available for this command. To display
the help information, enter one of the following:
ZFILE HELP mknod
ZFILE HELP
ZFILE ?
In addition, the correct command syntax is displayed if you enter the syntax
incorrectly.
- You must create a character special file to use a device driver.
- The major device number must correspond to a device driver index in
segment UDDTBL (for user device drivers) or CDDTBL (for IBM device
drivers). If no such device driver is installed, a 007515 system error
will result if the character special file is opened.
- The access mode for the new character special file is set to 0666;
that is, the owner, group, and others are authorized to read and write the
file. You can change the access mode by entering the ZFILE chmod
command or by calling the chmod function.
- This command supports the following three quoting mechanisms, which allow
you to override the special meaning of some characters:
- escape character (\)
- preserves the literal value of the character that follows. To
ignore the special meaning of a character, escape it by placing a backslash
(\) in front of it. In the example that follows, environment
variable PATH is /bin:/usr/bin:., the first
dollar sign ($) is escaped because of the preceding backslash, and the
second dollar sign takes on a special meaning.
User: ZFILE echo \$PATH is $PATH
System: $PATH is /bin:/usr/bin:.
- single quotation marks (' ')
- preserves the literal value of all characters between the opening single
quotation mark and the closing single quotation mark. For example,
entering ZFILE echo '*' displays an asterisk
character (*). Without the single quotation marks, the files
in the current working directory are displayed.
- double quotation marks (" ")
- preserves the literal value of all characters between the opening double
quotation mark and the closing double quotation mark except the dollar sign
($), the backquote (`), and the backslash (\).
This allows you to use the escape character inside double quotation marks,
which you cannot do in single quotation marks.
For example, entering ZFILE echo "\$PATH is \"$PATH\""
displays $PATH is "/bin:/usr/bin:."
If you want to use the literal meaning of any of the following
characters, you must always use a quoting mechanism:
left angle bracket (<)
| right angle bracket (>)
| ampersand (&)
|
backquote (`)
| backslash (\)
| dollar sign ($)
|
double quotation mark (")
| new-line (\n)
| left parenthesis ( ( )
|
right parenthesis ( ) )
| semicolon (;)
| single quotation mark (')
|
blank space
| tab
| vertical bar (|)
|
In addition, use a quoting mechanism when any of the following characters are
used in a way that takes on a special meaning but you want to use the literal
meaning:
asterisk (*)
| equal sign (=)
| left square bracket ( [ )
|
number sign (#)
| question mark (?)
| tilde (~)
|
Examples
In the following example, a new character special file named
/dev/my.device is created with major device number 2 and
minor device number 0.
+---------------------------------------------------------------------------------------------+
|User: zfile mknod /dev/my.device c 2 0 |
| |
|System: FILE0003I 15.19.34 mknod /dev/... COMPLETED SUCCESSFULLY. NO OUTPUT TO DISPLAY |
+---------------------------------------------------------------------------------------------+
Related Information