mkfifo(3)
NAME
mkfifo − make a FIFO special file
SYNOPSIS
#include <sys/types.h>
#include <sys/stat.h>
int mkfifo (path, mode)
char ∗path;
mode_t mode;
DESCRIPTION
mkfifo creates a new file named by the path name pointed to by path. The mode of the new file is initialized from mode. Where the value of mode is interpreted as follows:
0000400 read by owner
0000200 write by owner
0000100 execute (search on directory) by owner
0000070 read, write, execute (search) by group
0000007 read, write, execute (search) by others
The owner ID of the file is set to the effective user ID of the process. The group ID of the file is set to the effective group ID of the process.
Values of mode other than those above are undefined and should not be used. The low-order 9 bits of mode are modified by the process’s file mode creation mask: all bits set in the process’s file mode creation mask are cleared. See umask(2).
mkfifo will fail and the new fifo will not be created if one or more of the following are true:
[EACCESS] A component of the path prefix denies search permission.
[EEXIST] The named file already exists.
[ENAMETOOLONG] The length of the path string exceeds 1024 characters or a pathname component is longer than 255 characters.
[ENOENT] A component of the path prefix does not exist.
[ENOSPC] The directory that would contain the new file cannot be extended or the file system is out of file allocation resources.
[ENOTDIR] A component of the path prefix is not a directory.
[EROFS] The directory in which the file is to be created is located on a read-only file system.
[EFAULT] Path points outside the allocated address space of the process.
RETURN VALUE
Upon successful completion a value of 0 is returned. Otherwise, a value of −1 is returned and errno is set to indicate the error.
SEE ALSO
chmod(2), exec(2), pipe(2), stat(2), umask(2).
CX/UX Programmer’s Reference Manual