Unix/Linux Go Back    

Unix Version 7 - man page for pipe (v7 section 2)

Linux & Unix Commands - Search Man Pages
Man Page or Keyword Search:   man
Select Man Page Set:       apropos Keyword Search (sections above)

PIPE(2) 										  PIPE(2)

       pipe - create an interprocess 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.   Writes  with	a
       count of 4096 bytes or less are atomic; no other process can intersperse 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 descrip-
       tors closed) returns an end-of-file.

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

       The function value zero is returned if the pipe was created; -1	if  too  many  files  are
       already open.  A signal is generated if a write on a pipe with only one end is attempted.

       Should  more  than 4096 bytes be necessary in any pipe among a loop of processes, deadlock
       will occur.

       (pipe = 42.)
       sys pipe
       (read file descriptor in r0)
       (write file descriptor in r1)

Unix & Linux Commands & Man Pages : ©2000 - 2018 Unix and Linux Forums

All times are GMT -4. The time now is 03:57 PM.