PIPE (II)                    1/15/73                    PIPE (II)





NAME            pipe -- create a pipe



SYNOPSIS        sys pipe        / pipe = 42.; not in assembler

                (file descriptor in r0)



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



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



                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 (no synonymous file descriptors

                resulting from fork or dup) return an end-of-

                file.  Write calls under similar conditions are

                ignored.



SEE ALSO        sh(I), read(II), write(II), fork(II)



DIAGNOSTICS     The error bit (c-bit) is set if 10 files are al-

                ready open.



BUGS            --