Chapter 7

The Pipe File Manager

(PIPEMAN)

The Pipe file manager handles control of processes that use

paths to pipes. Pipes allow concurrently executing processes to

send each other data by using the output of one process (the

writer) as input to a second process (the reader). The reader gets

input from the standard input. The exclamation point (!) opera

tor specifies that the input or output is from or to a pipe. The

Pipe file manager allocates a 256-byte block and a path descrip

tor for data transfer. The Pipe file manager also determines

which process has control of the pipe. The Pipe file manager has

the standard file manager branch table at its entry point:




' lbra PRead












OS-9 Technical Reference

The ! operator tells the Shell that processes wish to communicate
through a pipe. For example:



In this example, shell forks Procl with the standard output path
to a pipe, and forks Proc2 with the Standard input path from a
pipe.

Shell can also handle a series of processes using pipes. Example:



The following outline shows how to set up pipes between
processes:


















7-2


Example: The following example shows how an application can
initiate another process with the stdin and stdout routed
through a pipe.

Open /pipe1 save path in variable a
Open /pipe2 save path in variable b
Dup 0 save stdin in variable x
Dup 1 save stdout in variable y
Close 0 make path available
Close 1 make path available
Dup a make pipe1 stdin
Dup b make pipe2 5tdout
Fork new process
Close 0 make path available
Close 1 make path available
Dup x restore stdin
Dup y restore stdout
Return a&b return pipe path numbers to caller













7-3