All rights reserved. The Berkeley software License Agreement
specifies the terms and conditions for redistribution.
@(#)pipe.2 6.2 (Berkeley) 08/26/85
pipe(fildes) int fildes[2];
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.
The shell has a syntax to set up a linear array of processes connected by pipes.
Read calls on an empty pipe (no buffered data) with only one end (all write file descriptors closed) returns an end-of-file.
Pipes are really a special case of the socketpair (2) call and, in fact, are implemented as such in the system.
A signal is generated if a write on a pipe with only one end is attempted.
15 [EMFILE] Too many descriptors are active.
15 [ENFILE] The system file table is full.
15 [EFAULT] The fildes buffer is in an invalid area of the process's address space.