mkfifo() - make a FIFO special file
#include <sys/types.h>
#include <sys/stat.h>
int mkfifo(const char *path, mode_t mode);
The mkfifo() function creates a new FIFO special file pointed to by path. The file permission bits of the new FIFO are initialized from mode. The file permission bits of the mode argument are modified by the process' file creation mask.
When bits in mode other than the file permission bits are set, the effect is implementation-dependent.
The FIFO's user ID will be set to the process' effective user ID. The FIFO's group ID will be set to the group ID of the parent directory or to the effective group ID of the process.
Upon successful completion, mkfifo() will mark for update the st_atime, st_ctime and st_mtime fields of the file. Also, the st_ctime and st_mtime fields of the directory that contains the new entry are marked for update.
Upon successful completion, 0 is returned. Otherwise, -1 is returned, no FIFO is created and errno is set to indicate the error.
The mkfifo() function will fail if:
The mkfifo() function may fail if:
umask(2)
Derived from the POSIX.1-1988 standard.