/sys$common/syshlp/helplib.hlb CC, Run-time functions, pipe *Conan The Librarian (sorry for the slow response - running on an old VAX) |
Creates a temporary mailbox. You must use a mailbox to read and write data between the parent and child. The channels through which the processes communicate are called a pipe. Syntax: #include <unistd.h> int pipe(int file_descriptor[2]); (POSIX-1) int pipe(int file_descriptor[2],...); (Compaq C Extension) where: file_descriptor[2] - is an array of file descriptors. A pipe is implemented as an array of file descriptors associated with a mailbox. These mailbox descriptors are special in that these are the only file descriptors which, when passed to the isapipe function, will return 1. Element 0 of the file_descriptor array contains the descriptor for reading; element 1 contains the descriptor for writing. .. represents two optional arguments: flags - If either the O_NDELAY or O_NONBLOCK bit is set, the I/O operations to the mailbox through the specified file descriptors will terminate immediately, rather than waiting for another process. If, for example, the O_NDELAY bit is set and the child issues a read request to the mailbox before the parent has put any data into it, the read terminates immediately with zero status. If neither the O_NDELAY nor O_NONBLOCK bit is set, the child will be waiting on the read until the parent writes any data into the mailbox. This is the default behavior if no flag argument is specified. The values of O_NDELAY and O_NONBLOCK are defined in the <fcntl.h> header file. Any other bits in the flag argument are ignored. You must specify this argument if the second optional, positional argument bufsize is specified. If the flag argument is needed only to allow specification of the bufsize argument, specify flag as zero. bufsize -- specifies the size of the mailbox, in bytes. If you do not specify this argument, a mailbox is created with a default size of 512 bytes.
|