9.10 Named Pipes (Fifos)
A named pipe—also called a fifo—is an abstraction that provides the functionality of an unnamed pipe but uses the file system namespace to represent the pipe, allowing readers and writers to open the fifo file like a regular file. A fifo can be created using the mkfifo() system call or through the mkfifo command-line program.
If a fifo is opened for reading, the open() call will block if there are no writers—that is, if somebody else does not have the fifo open for writing. Conversely, if a fifo is opened for writing, the open() will block if there are no readers. It is possible to open a fifo in nonblocking mode by specifying the O_NONBLOCK flag in the open() call. A nonblocking open for reading will return immediately, ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access