.th pipe IV 4/21/86
.sh NAME
pipe - create an interprocess channel
.sh SYNOPSIS
pipe(fildes)
.br
int fildes[2];
.ft R
.sh DESCRIPTION
The pipe system call creates an I/O mechanism called a pipe.  The file
descriptors returned can be used in read and write operations.  When
the pipe is written using the descriptor returned in fildes[1], up to
4096 bytes of data are buffered before the writing process is
suspended.  A read using the descriptor returned in fildes[0] will pick
up the data.
.s3
It is assumed that after the pipe has been set up, two (or more)
cooperating processes (created by subsequent fork calls) will pass data
through the pipe with read and write calls.
.s3
Read calls on an empty pipe (no buffered data) with only one end (all
write file descriptors closed) return an end-of-file.  For write calls
under similar conditions an error is returned on the write.
.sh "SEE ALSO"
read (IV), write (IV), fork (IV)
.sh DIAGNOSTICS
The error bit (c-bit) is set if too many files are already open.  From
C, a -1 returned value indicates an error.  An error is returned if a
write on a pipe with only one end is attempted.
