5 /* open/read/write/close */
8 /** If buffer is too small to hold entire string, it is incremented by this value */
12 * Program grabs data (calculated number of characters) from process2 and prints
13 * grabbed data to the standard output.
16 /** Named pipe used to communicate with process2 */
17 char * read_pipe = "/tmp/process2pipe";
26 /* Reading from process2 */
27 read_descriptor = open(read_pipe, O_RDONLY);
29 int number_of_characters = 0;
32 /* Read data from input pipe */
33 count = read(read_descriptor, &buffer, sizeof(int));
35 fprintf(stderr, "[%s] Fetched: %d bytes\n", "process3", count);
38 fprintf(stderr, "[%s] Process2 send: %d\n", "process3", buffer);
45 close(read_descriptor);