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, ...

Get Mac OS X Internals: A Systems Approach now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.