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 from process1, calculates number of characters in each line
13 * and pass the value to process3.
16 /** Named pipe used to communicate with process1 */
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);