Manual Page Result
0
Command: pipe | Section: 2 | Source: UNIX v10 | File: pipe.2
PIPE(2) System Calls Manual PIPE(2)
NAME
pipe - create an interprocess channel
SYNOPSIS
int pipe(fildes)
int fildes[2];
DESCRIPTION
Pipe creates a buffered channel for interprocess I/O communication.
Two file descriptors returned in fildes are the ends of pair of cross-
connected streams; see stream(4). Data written via fildes[1] is avail-
able for reading via fildes[0] and vice versa.
After the pipe has been set up, cooperating processes created by subse-
quent fork(2) calls may pass data through the pipe with read and write
calls. The bytes placed on a pipe by one write are contiguous even if
many process are writing. Writes induce a record structure: a read
will not return bytes from more than one write; see read(2).
Write calls on a one-ended pipe raise signal SIGPIPE. Read calls on a
one-ended pipe with no data in it return an end-of-file for the first
several attempts, then raise SIGPIPE, and eventually SIGKILL.
SEE ALSO
sh(1), fork(2), read(2), select(2), stream(4)
DIAGNOSTICS
EIO, EMFILE, ENFILE, ENXIO
BUGS
Buffering in pipes connecting multiple processes may cause deadlocks.
Some line discipline modules discard the record delimiters inserted by
write.
On many other versions of the system, only fildes[0] may be read and
only fildes[1] may be written.
PIPE(2)