home *** CD-ROM | disk | FTP | other *** search
/ Fresh Fish 8 / FreshFishVol8-CD1.bin / gnu / man / cat2 / pipe.0 < prev    next >
Text File  |  1993-12-07  |  2KB  |  67 lines

  1.  
  2. PIPE(2)                    UNIX Programmer's Manual                    PIPE(2)
  3.  
  4. NNAAMMEE
  5.      ppiippee - create descriptor pair for interprocess communication
  6.  
  7. SSYYNNOOPPSSIISS
  8.      ##iinncclluuddee <<uunniissttdd..hh>>
  9.  
  10.      _i_n_t
  11.      ppiippee(_i_n_t _*_f_i_l_d_e_s)
  12.  
  13. DDEESSCCRRIIPPTTIIOONN
  14.      The ppiippee() function creates a _p_i_p_e, which is an object allowing unidirec­
  15.      tional data flow, and allocates a pair of file descriptors.  The first
  16.      descriptor connects to the _r_e_a_d _e_n_d of the pipe, and the second connects
  17.      to the _w_r_i_t_e _e_n_d, so that data written to _f_i_l_d_e_s_[_1_] appears on (i.e., can
  18.      be read from) _f_i_l_d_e_s_[_0_]. This allows the output of one program to be sent
  19.      to another program: the source's standard output is set up to be the
  20.      write end of the pipe, and the sink's standard input is set up to be the
  21.      read end of the pipe.  The pipe itself persists until all its associated
  22.      descriptors are closed.
  23.  
  24.      A pipe whose read or write end has been closed is considered _w_i_d_o_w_e_d.
  25.      Writing on such a pipe causes the writing process to receive a SIGPIPE
  26.      signal.  Widowing a pipe is the only way to deliver end­of­file to a
  27.      reader: after the reader consumes any buffered data, reading a widowed
  28.      pipe returns a zero count.
  29.  
  30.      Pipes are really a special case of the socketpair(2) call and, in fact,
  31.      are implemented as such in the system.
  32.  
  33. RREETTUURRNN VVAALLUUEESS
  34.      On successful creation of the pipe, zero is returned. Otherwise, a value
  35.      of ­1 is returned and the variable _e_r_r_n_o set to indicate the error.
  36.  
  37. EERRRROORRSS
  38.      The ppiippee() call will fail if:
  39.  
  40.      [EMFILE]  Too many descriptors are active.
  41.  
  42.      [ENFILE]  The system file table is full.
  43.  
  44.      [EFAULT]  The _f_i_l_d_e_s buffer is in an invalid area of the process's ad­
  45.                dress space.
  46.  
  47. SSEEEE AALLSSOO
  48.      sh(1),  read(2),  write(2),  fork(2),  socketpair(2)
  49.  
  50. HHIISSTTOORRYY
  51.      A ppiippee function call appeared in Version 6 AT&T UNIX.
  52.  
  53. 4th Berkeley Distribution       March 10, 1991                               1
  54.  
  55.  
  56.  
  57.  
  58.  
  59.  
  60.  
  61.  
  62.  
  63.  
  64.  
  65.  
  66.  
  67.