Lines Matching defs:comm_pipes

108 struct comm_pipes {
113 static int setup_comm_pipes(struct comm_pipes *comm_pipes)
115 if (pipe(comm_pipes->child_ready) < 0)
117 if (pipe(comm_pipes->parent_ready) < 0) {
118 close(comm_pipes->child_ready[0]);
119 close(comm_pipes->child_ready[1]);
126 static void close_comm_pipes(struct comm_pipes *comm_pipes)
128 close(comm_pipes->child_ready[0]);
129 close(comm_pipes->child_ready[1]);
130 close(comm_pipes->parent_ready[0]);
131 close(comm_pipes->parent_ready[1]);
135 struct comm_pipes *comm_pipes)
144 write(comm_pipes->child_ready[1], "0", 1);
145 while (read(comm_pipes->parent_ready[0], &buf, 1) != 1)
153 struct comm_pipes *comm_pipes)
185 write(comm_pipes->child_ready[1], "0", 1);
186 while (read(comm_pipes->parent_ready[0], &buf, 1) != 1)
199 typedef int (*child_fn)(char *mem, size_t size, struct comm_pipes *comm_pipes);
204 struct comm_pipes comm_pipes;
208 ret = setup_comm_pipes(&comm_pipes);
219 exit(fn(mem, size, &comm_pipes));
222 while (read(comm_pipes.child_ready[0], &buf, 1) != 1)
234 write(comm_pipes.parent_ready[1], "0", 1);
242 write(comm_pipes.parent_ready[1], "0", 1);
263 close_comm_pipes(&comm_pipes);
297 struct comm_pipes comm_pipes;
307 ret = setup_comm_pipes(&comm_pipes);
331 write(comm_pipes.child_ready[1], "0", 1);
332 while (read(comm_pipes.parent_ready[0], &buf, 1) != 1)
348 while (read(comm_pipes.child_ready[0], &buf, 1) != 1)
354 write(comm_pipes.parent_ready[1], "0", 1);
388 close_comm_pipes(&comm_pipes);
407 struct comm_pipes comm_pipes;
417 ret = setup_comm_pipes(&comm_pipes);
469 write(comm_pipes.child_ready[1], "0", 1);
470 while (read(comm_pipes.parent_ready[0], &buf, 1) != 1)
475 while (read(comm_pipes.child_ready[0], &buf, 1) != 1)
541 write(comm_pipes.parent_ready[1], "0", 1);
553 close_comm_pipes(&comm_pipes);
579 struct comm_pipes comm_pipes;
595 ret = setup_comm_pipes(&comm_pipes);
615 write(comm_pipes.child_ready[1], "0", 1);
616 while (read(comm_pipes.parent_ready[0], &buf, 1) != 1)
622 while (read(comm_pipes.child_ready[0], &buf, 1) != 1)
631 write(comm_pipes.parent_ready[1], "0", 1);
691 write(comm_pipes.parent_ready[1], "0", 1);
700 close_comm_pipes(&comm_pipes);
1223 struct comm_pipes comm_pipes;
1227 ret = setup_comm_pipes(&comm_pipes);
1289 exit(child_memcmp_fn(mem, size, &comm_pipes));
1292 exit(child_memcmp_fn(mem, size / 2, &comm_pipes));
1296 &comm_pipes));
1303 while (read(comm_pipes.child_ready[0], &buf, 1) != 1)
1318 write(comm_pipes.parent_ready[1], "0", 1);
1329 write(comm_pipes.parent_ready[1], "0", 1);
1340 write(comm_pipes.parent_ready[1], "0", 1);
1350 close_comm_pipes(&comm_pipes);