Open System Services System Calls Reference Manual (G06.29+, H06.08+, J06.03+)
System Functions (k - m) mknod(2)
NAME
mknod - Creates a file or assigns a pathname to a character special file
LIBRARY
G-series native Guardian processes: system library
G-series native OSS processes: system library
H-series and J-series native Guardian processes: implicit libraries
H-series and J-series OSS processes: implicit libraries
SYNOPSIS
#include <sys/stat.h>
int mknod(
const char *path,
mode_t mode,
dev_t device);
PARAMETERS
path Specifies the pathname of the new file. If the final component of the path param-
eter names a symbolic link, the link is traversed and pathname resolution contin-
ues.
mode Specifies the file type, attributes, and access permissions. This parameter is con-
structed by logically ORing one file type value with any valid value for an attri-
bute for a file of that type, and with any valid access permissions.
The following file type values are supported:
S_IFCHR The file is a character special file.
S_IFDIR The file is a directory special file.
S_IFIFO The file is a FIFO special file.
S_IFREG The file is a regular file.
Values other than S_IFIFO can be used only if the process has appropriate
privileges.
The file type value S_IFBLK is not supported in the OSS file system. If
S_IFBLK is specified, 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 file
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 file
527186-023 Hewlett-Packard Company 4−53