The pipe() function creates an I/O mechanism called a pipe and returns two file descriptors, fildes[0] and fildes[1]. The files associated with fildes[0] and fildes[1] are streams and are both opened for reading and writing.
The O_NDELAY and O_NONBLOCK flags are cleared.
A read from fildes[0] accesses the data written to fildes[1] on a first-in-first-out (FIFO) basis and a read from fildes[1] accesses the data written to fildes[0] also on a FIFO basis.
The FD_CLOEXEC flag will be clear on both file descriptors.
Upon successful completion pipe() marks for update the st_atime, st_ctime, and st_mtime fields of the pipe.
|