home *** CD-ROM | disk | FTP | other *** search
/ minnie.tuhs.org / unixen.tar / unixen / PDP-11 / Trees / V6 / usr / man / man2 / pipe.2 < prev    next >
Encoding:
Text File  |  1975-06-26  |  1.4 KB  |  70 lines

  1. .th PIPE II 8/5/73
  2. .sh NAME
  3. pipe \*- create an interprocess channel
  4. .sh SYNOPSIS
  5. (pipe = 42.)
  6. .br
  7. .ft B
  8. sys pipe
  9. .br
  10. .ft R
  11. (read file descriptor in r0)
  12. .br
  13. (write file descriptor in r1)
  14. .s3
  15. .ft B
  16. pipe(fildes)
  17. .br
  18. int fildes[2];
  19. .ft R
  20. .sh DESCRIPTION
  21. The
  22. .it pipe
  23. system call
  24. creates an I/O mechanism called a pipe.
  25. The file descriptors returned can
  26. be used in read and write operations.
  27. When the pipe is written using the descriptor
  28. returned in r1 (resp. fildes[1]),
  29. up to 4096 bytes of data are buffered
  30. before the writing process is suspended.
  31. A read using the descriptor returned in r0
  32. (resp. fildes[0])
  33. will pick up the data.
  34. .s3
  35. It is assumed that after the
  36. pipe has been set up,
  37. two (or more)
  38. cooperating processes
  39. (created by subsequent
  40. .it fork
  41. calls)
  42. will pass data through the
  43. pipe with
  44. .it read
  45. and
  46. .it write
  47. calls.
  48. .s3
  49. The Shell has a syntax
  50. to set up a linear array of processes
  51. connected by pipes.
  52. .s3
  53. Read calls on an empty
  54. pipe (no buffered data) with only one end
  55. (all write file descriptors closed)
  56. return an end-of-file.
  57. Write calls under similar conditions generate
  58. a fatal signal (signal (II)); if the signal is ignored,
  59. an error is returned on the write.
  60. .sh "SEE ALSO"
  61. sh (I), read (II), write (II), fork (II)
  62. .sh DIAGNOSTICS
  63. The error
  64. bit (c-bit) is set if
  65. too many files are already open.
  66. From C, a \*-1 returned value
  67. indicates an error.
  68. A signal is generated if a write on a pipe with only one end is attempted.
  69. .sh BUGS
  70.