Open System Services System Calls Reference Manual (G06.28+, H06.05+)
mknod(2) OSS System Calls Reference Manual
S_ISGID Set the group ID of the file upon execution of the file
S_ISUID Set the user ID of the file upon execution of the file
S_ISVTX Restrict the deletion of files in a directory (ignored for other file
types)
S_IWGRP Write access by members of the group list
S_IWOTH Write access by others
S_IWUSR Write access by the owner of the file
S_IXGRP Execute (search) access by members of the group list
S_IXOTH Execute (search) access by others
S_IXUSR Execute (search) access by the owner of the file
device Specifies the type of device on which the file is created. This hexadecimal value
must be 0 (zero) unless the file type S_IFCHR is specified for the mode parame-
ter. When S_IFCHR is specified, the following values are valid:
0x0000000300000000
The device is an infinite data source or data sink, such as
/dev/null.
0x0000000200000000
The device is a controlling terminal, such as /dev/tty.
Specifying any other value for the device parameter when S_IFCHR is specified
for the mode parameter causes the function call to fail and errno to be set to
[EINVAL].
DESCRIPTION
The mknod() function creates a new special or regular file. Using the mknod( ) function to
create file types other than FIFOs requires appropriate privileges.
When the mknod( ) function creates a regular file in a fileset that supports access control lists |
(ACLs), and the parent directory for that file has an ACL that contains default ACL entries, the |
ACL for the file inherits the default ACL entries of the parent directory as actual (nondefault) |
ACL entries for the new file. When the mknod( ) function creates a directory in a fileset that |
supports ACLs, the ACL for the new directory inherits the default ACL entries of the parent |
directory both as default and as actual (nondefault) ACL entries. For detailed information about |
ACL inheritance, see the acl(5) reference page.
For the mknod() function to finish successfully, a process must have search permission and write
permission in the parent directory of the path parameter.
The new file has the following characteristics:
• A file type as specified by the mode parameter.
• An owner ID set to the effective user ID of the process.
• A group ID set to the effective group ID of the process or to the group ID of the parent
directory of the file.
4−54 Hewlett-Packard Company 527186-007