Creates a special file.
Item | Description |
---|---|
dvp | Points to the virtual node (v-node) for the directory to contain the new file. This v-node is held for the duration of the vnop_mknod entry point. |
name | Specifies the name of a new file. |
mode | Identifies the integer mode that indicates the type of file and its permissions. |
dev | Identifies an integer device number. |
crp | Points to the cred structure. This structure contains data that applications can use to validate access permission. |
The vnop_mknod entry point is invoked by the logical file system as the result of a mknod subroutine. The underlying file system is expected to create a new file in the given directory. The file type bits of the mode parameter indicate the type of file (regular, character special, or block special) to be created. If a special file is to be created, the dev parameter indicates the device number of the new special file.
The logical file system verifies that the dvp parameter does not reside in a read-only file system.
The vnop_mknod entry point can be called from the process environment only.
Item | Description |
---|---|
0 | Indicates success. |
Nonzero return values are returned from the /usr/include/sys/errno.h file to indicate failure.