Open System Services System Calls Reference Manual (G06.25+, H06.03+)

System Functions (k - m) mknod(2)
NAME
mknod - Creates a le or assigns a pathname to a character special le
LIBRARY
G-series native Guardian processes: system library
G-series native OSS processes: system library
H-series native Guardian processes: implicit libraries
H-series OSS processes: implicit libraries
SYNOPSIS
#include <sys/stat.h>
int mknod(
const char *path,
mode_t mode,
dev_t device);
PARAMETERS
path Species the pathname of the new le. If the nal component of the path param-
eter names a symbolic link, the link is traversed and pathname resolution contin-
ues.
mode Species the le type, attributes, and access permissions. This parameter is con-
structed by logically ORing one le type value with any valid value for an attri-
bute for a le of that type, and with any valid access permissions.
The following le type values are supported:
S_IFCHR The le is a character special le.
S_IFDIR The le is a directory special le.
S_IFIFO The le is a FIFO special le.
S_IFREG The le is a regular le.
Values other than S_IFIFO can be used only if the process has appropriate
privileges.
The le type value S_IFBLK is not supported in the OSS le system. If
S_IFBLK is specied, the function call fails and errno is set to the value of
[EINVAL].
The following access permissions are supported:
S_IRGRP Read access by members of the group list
S_IROTH Read access by others
S_IRUSR Read access by the owner of the le
S_IRWXG Read, write, or execute (search) access by members of the group
list
S_IRWXO Read, write, or execute (search) access by others
S_IRWXU Read, write, or execute (search) access by the owner of the le
527186-003 Hewlett-Packard Company 427