3 /* open/read/write/close */
7 * Program grabs data (calculated number of characters) from process2 and prints
8 * grabbed data to the standard output.
11 /** Named pipe used to communicate with process2 */
12 char * read_pipe = "/tmp/process2pipe";
14 /** Descriptor of input pipe */
17 /** Buffer used for storing data from input pipe */
20 /** Stores number of bytes read from input pipe in current iteration */
23 /* Reading from process2 */
24 read_descriptor = open(read_pipe, O_RDONLY);
26 fprintf(stderr, "[%s] Init!\n", "process3");
29 /* Read data from input pipe */
30 count = read(read_descriptor, &buffer, sizeof(int));
32 fprintf(stderr, "[%s] Fetched: %d bytes\n", "process3", count);
35 fprintf(stderr, "[%s] Process2 send: %d\n", "process3", buffer);
42 close(read_descriptor);