Pipes and FIFOs
QNX SDP8.0System ArchitectureDeveloperUser
Pipes and FIFOs are both forms of queues that connect processes.
Note:
In order for you to use pipes or FIFOs in the QNX OS, the pipe
resource manager
(pipe)
must be running.
- Pipes
- A pipe is an unnamed file that serves as an I/O
channel between two or more cooperating processes: one
process writes into the pipe and the other reads from the pipe.
The pipe manager takes care of buffering the data. The buffer size is defined as PIPE_BUF in the <limits.h> file. A pipe is removed once both of its ends have closed. The function pathconf() returns the value of the limit.
Pipes are normally used when two processes want to run in parallel, with data moving from one process to the other in a single direction. (If bidirectional communication is required, messages should be used instead.)
A typical application for a pipe is connecting the output of one program to the input of another program. This connection is often made by the shell. For example:
directs the standard output from the ls utility through a pipe to the standard input of the more utility.ls | more
- FIFOs
- FIFOs are essentially the same as pipes, except that FIFOs are named permanent files that are stored in filesystem directories.
Page updated: