Go to main content

STREAMS Programming Guide

Exit Print View

Updated: November 2020
 
 

Overview of Pipes and FIFOs

A pipe provides a communication path between multiple processes. Prior to the Oracle Solaris 11.4 release, there were standard pipes and named pipes, also called FIFOs. With standard pipes, one end was opened for reading and the other end for writing, so data flow was unidirectional. FIFOs had only one end and one process opened the file for reading and another process opened the file for writing. Data written into the FIFO by the writer could then be read by the reader.

To provide support and development flexibility for networked applications, pipes and FIFOs are STREAMS-based in the Oracle Solaris software. The interface is unchanged but the underlying implementation is changed. When a pipe is created through the pipe interface, two streams are opened and connected. Data flow is serial.

The terms pipe and STREAMS-based pipe are used interchangeably in this chapter to mean a STREAMS-based pipe.


Note -  After both ends of a FIFO have been opened, there is no guarantee that further calls to open O_RDONLY (O_WRONLY) will synchronize with later calls to open() O_WRONLY (O_RDONLY) until both ends of the FIFO have been closed by all readers and writers. Any data written into a FIFO will be lost if both ends of the FIFO are closed before the data is read.

For more information, see the pipe(2) man page.