Query: pipe
OS: bsd
Section: 2
Format: Original Unix Latex Style Formatted with HTML and a Horizontal Scroll Bar
PIPE(2) System Calls Manual PIPE(2)NAMEpipe - create an interprocess communication channelSYNOPSISpipe(fildes) int fildes[2];DESCRIPTIONThe 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 fildes[1] up to 4096 bytes of data are buffered before the writing process is suspended. A read using the descriptor fildes[0] will pick up the data. 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.RETURN VALUEThe function value zero is returned if the pipe was created; -1 if an error occurred.ERRORSThe pipe call will fail if: [EMFILE] Too many descriptors are active. [ENFILE] The system file table is full. [EFAULT] The fildes buffer is in an invalid area of the process's address space.SEE ALSOsh(1), read(2), write(2), fork(2), socketpair(2)BUGSShould more than 4096 bytes be necessary in any pipe among a loop of processes, deadlock will occur. 4th Berkeley Distribution August 26, 1985 PIPE(2)
Related Man Pages |
---|
pipe(2) - bsd |
pipe2(2) - freebsd |
pipe(2) - ultrix |
pipe(2) - osx |
pipe(2) - netbsd |
Similar Topics in the Unix Linux Community |
---|
Overwrite |
remove named pipes |
Awk to Search and Replace inside the pipe "|" |
write failed: Broken pipe |
Ksh: run commands from pipe |