Lines Matching refs:p2child
130 * p2child: half duplex pipes from parent to child (parent writes,
157 int p2child[MAXCHILD][2]; /* Pipes from parent to child processes */
192 * p2child: for sending packets from the parent process to the child
214 if (pipe(&p2child[i][0]) < 0)
217 if (fcntl(p2child[i][READ], F_SETFL, O_NONBLOCK) < 0)
220 if (fcntl(p2child[i][WRITE], F_SETFL, O_NONBLOCK) < 0)
232 * Then close the READ end of the p2child pipe, since the parent
245 child(&p2child[i][0], p2parent);
251 if (close(p2child[i][READ]) < 0)
282 if ((n = write(p2child[i][WRITE], &packet,
300 * After sending the last packet, close the WRITE end of the p2child
318 if (write(p2child[i][WRITE], &packet, sizeof(packet)) < 0) {
325 if (close(p2child[i][WRITE]) < 0)
379 | Args: p2child - Pipe from parent to child |
385 void child(int p2child[], int p2parent[])
398 * Close the WRITE end of the p2child pipe, since the child
403 if (close(p2child[WRITE]) < 0)
411 * Read packets from the parent through p2child pipe. Upon
420 * the p2child READ pipe, as we are finished receiving packets
425 n = read(p2child[READ], &packet, sizeof(packet));
473 if (close(p2child[READ]) < 0)
645 close(p2child[i][READ]);
646 close(p2child[i][WRITE]);