The simplest way to communicate with Linux processes is through anonymous pipelines
The creation of anonymous pipelines requires the use of the pipe function, the pipe function parameter is an array
represents the file description word. This array has two file description words, the first one is to use a
the file descriptor for the read data The second is a file descriptor for writing data.
You cannot use a file descriptor for write read operation or read file description
Identifier write operations, which can cause errors.
A few notes about anonymous pipelines:
1. The anonymous pipeline is half-duplex, that is, a process can read only, and a process can write only
To achieve full duplex, two anonymous pipes are required.
2. Communication can only be done in a parent-child or sibling process.
3. Close the Write file descriptor when reading, close the read file descriptor when writing
The code is implemented as follows (parent-child communication):
Linux process communication----Anonymous pipeline