PIPE(2)             UNIX Programmer's Manual		  PIPE(2)

     pipe - create an interprocess communication channel

     int fildes[2];

     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
     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

     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-

     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.

     The function value zero is returned if the pipe was created;
     -1 if an error occurred.

     The 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.

     sh(1), read(2), write(2), fork(2), socketpair(2)

     Should more than 4096 bytes be necessary in any pipe among a

Printed 11/26/99	 August 26, 1985			1

PIPE(2)             UNIX Programmer's Manual		  PIPE(2)

     loop of processes, deadlock will occur.

Printed 11/26/99	 August 26, 1985			2

Generated: 2016-12-26
Generated by man2html V0.25
page hit count: 886
Valid CSS Valid XHTML 1.0 Strict