pipe
Creates an inter-process channel.
#include <unistd.h>
int pipe (
int fildes[2]);
pipe returns zero upon successful completion. Otherwise, -1 is returned and errno indicates the occurring error.
If an error occurs, errno can be set to:
pipe 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 shall be the two lowest that available at the time pipe is called. O_NONBLOCK and FD_CLOEXEC, 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.