Syntax | #include <sys/stat.h> int mknod(const char *path, mode_t mode, dev_t dev); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Description |
The file type for path is incorporated in the mode argument via a bit-wise OR. The file type must be one of the following symbolic constants:
The user ID of the file is set to the effective user ID of the process, and the group ID of the file is set to the effective group ID of the process, unless the The access permission bits of mode are modified by the file mode creation mask of the process: all bits which are set in the file mode creation mask are set to 0 by If mode indicates a block- or character-special file, dev is the configuration-dependent specification of that file; if mode does not indicate a block- or character-special file, dev is ignored (see For non-FIFO file types, The When the value | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Return val. | 0 | if successful. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Return val. | -1 | if an error occurs; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Errors |
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
| Either there is no search permission for a component of the path, or there is no write permission for the parent directory of the new file. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
| The specified file already exists. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
| A signal was caught during the | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
| An argument is invalid. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
| An I/O error occurred during access to the file system. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
| Too many symbolic links were encountered in resolving path. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
The length of the path argument exceeds The resolving of a symbolic link led to an interim result whose length exceeds | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| A component of the path prefix does not exist or path is an empty string. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| path refers to a remote computer and the link to this computer is no longer active. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| The directory in which the file is to be created cannot be extended, or no memory is available. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| A component of the path prefix is not a directory. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| The effective user ID is not that of the system administrator and the file type is not FIFO. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| The directory in which the file is to be created is located on a read-only file system. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
In addition, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| The file descriptor fd was not opened with | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| The path parameter does not specify an absolute pathname, and the fd parameter does not have the value | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| The path parameter does not specify an absolute pathname, and the file descriptor fd is not connected with a directory. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Notes |
If For reasons of portability to implementations which comply with earlier versions of the X/Open standard, the | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
See also |
|