When a process executes another process, either by one of the exec()
family of
functions, fork()
, etc., the child process inherits all of the parent's file
descriptors. This means if a parent has two file descriptors that are entangled
(i.e., a read end and a write end), the parent process can simply write to the
write end, and the child process can read from the read end.
┌────────────────┐