Creates an inter-process channel.
#include <unistd.h> int pipe ( int fildes[2]);
(OUT) Specifies the file descriptions for the ends of the newly created pipe.
If successful, returns 0. Otherwise, returns -1 and sets errno to one of the following:
The pipe function creates a pipe and places two file descriptions (into fildes[0] and fildes[1]) for the read and write ends of the pipe. Their integer values are two lowest that are available at the time pipe is called. The O_NONBLOCK and FD_CLOEXEC flags, which can be set by calling fcntl, should be clear on both file descriptors.
Data can be written to fildes[1] and read from fildes[0]. A read on fildes[0] accesses the data written to fildes[1] on a first-in-first-out basis.
A process has the pipe open for reading if it has a file descriptor open that refers to the read end, fildes[0]. A process has the pipe open for writing if it has a file descriptor open that refers to the write end, fildes[1].
Upon successful completion, pipe updates the st_atime, st_ctime, and st_mtime fields of the new pipe.