Research V4 development
[unix-history] / man / man2 / pipe.2
index 7c16131..ec6a199 100644 (file)
@@ -1,51 +1,66 @@
-.pa 1
-.he 'PIPE (II)'1/15/73'PIPE (II)'
-.ti 0
-NAME           pipe -- create a pipe
-.sp
-.ti 0
-SYNOPSIS       sys pipe        / pipe = 42.; not in assembler
+.th PIPE II 8/5/73
+.sh NAME
+pipe \*- create a pipe
+.sh SYNOPSIS
+(pipe = 42.)
 .br
 .br
-(file descriptor in r0)
-.sp
-.ti 0
-DESCRIPTION    The
-pipe\b\b\b\b____
+.ft B
+sys pipe
+.br
+.ft R
+(read file descriptor in r0)
+.br
+(write file descriptor in r1)
+.s3
+.ft B
+pipe(fildes)
+.br
+int fildes[2];
+.ft R
+.sh DESCRIPTION
+The
+.it pipe
 system call
 creates an I/O mechanism called a pipe.
 system call
 creates an I/O mechanism called a pipe.
-The file descriptor returned can
-be used in both read and write operations.
-When the pipe is written,
-the data is buffered up to 504 bytes
-at which time the writing process is suspended.
-A read on the pipe will pick up the buffered data.
-.sp
+The file descriptors returned can
+be used in read and write operations.
+When the pipe is written using the descriptor
+returned in r1 (resp. fildes[1]),
+up to 4096 bytes of data are buffered
+before the writing process is suspended.
+A read using the descriptor returned in r0
+(resp. fildes[0])
+will pick up the data.
+.s3
 It is assumed that after the
 It is assumed that after the
-pipe\b\b\b\b____ has been set up,
+pipe has been set up,
 two (or more)
 cooperating processes
 two (or more)
 cooperating processes
-(created by subsequent fork\b\b\b\b____ calls)
+(created by subsequent
+.it fork
+calls)
 will pass data through the
 will pass data through the
-pipe with read\b\b\b\b____ and write\b\b\b\b\b_____ calls.
-
+pipe with
+.it read
+and
+.it write
+calls.
+.s3
 The shell has a syntax
 to set up a linear array of processes
 connected by pipes.
 The shell has a syntax
 to set up a linear array of processes
 connected by pipes.
-.sp
+.s3
 Read calls on an empty
 pipe (no buffered data) with only one end
 Read calls on an empty
 pipe (no buffered data) with only one end
-(no synonymous file
-descriptors resulting from fork\b\b\b\b____ or dup\b\b\b___)
+(all write file descriptors closed)
 return an end-of-file.
 Write calls under similar conditions are ignored.
 return an end-of-file.
 Write calls under similar conditions are ignored.
-
-.ti 0
-SEE ALSO       sh(I), read(II), write(II), fork(II)
-.sp
-.ti 0
-DIAGNOSTICS    The error
+.sh "SEE ALSO"
+sh(I), read(II), write(II), fork(II)
+.sh DIAGNOSTICS
+The error
 bit (c-bit) is set if
 bit (c-bit) is set if
-10 files are already open.
-.sp
-.ti 0
-BUGS           --
+more than
+8 files are already open.
+From C, a \*-1 returned value
+indicates an error.