Lines Matching defs:child
56 * set up pipe for parent/child communications
57 * fork off a child process
61 * wait for child to send ready message over pipe
62 * send all catchable signals to child process
64 * wait for child to terminate and check exit value
75 * else if exit is HANDLE_ERR then BROK (error in child's
79 * child():
96 * since child is executing system calls under test, no
126 static void child(void);
145 #define CHILD_EXIT(VAL) ((VAL >> 8) & 0377) /* exit value of child process */
146 #define CHILD_SIG(VAL) (VAL & 0377) /* signal value of child proc */
150 #define READY "ready" /* signal to parent that child is set up */
154 /* child exit values */
164 static int pid; /* process id of child */
166 static int pipe_fd2[2]; /* file descriptors for pipe child read */
196 maybe_run_child(&child, "dd", &pipe_fd[1], &pipe_fd2[0]);
209 * fork off a child process
225 child();
237 * parent() : wait for "ready" from child, send signals to child, wait for
238 * child to exit and report what happened.
242 int term_stat; /* child return status */
246 int *array; /* pointer to sig_array returned from child */
251 /* wait for "ready" message from child */
258 /* child setup did not go well */
263 * send signals to child and see if it holds them
288 "Unable to tell child to go, write to pipe failed");
292 * child is now releasing signals, wait and check exit value
296 /* check child's signal exit value */
298 /* the child was zapped by a signal */
299 tst_brkm(TBROK, cleanup, "Unexpected signal %d killed child",
302 /* get child exit value */
359 /* the write() call failed in child's write_pipe */
360 tst_resm(TBROK, "write() pipe failed for child.");
367 tst_resm(TBROK, "Unexpected exit code %d from child", rv);
374 * child() : hold signals, notify parent and wait for parent to send signals.
379 static void child(void)
445 printf("child: PHASE II\n");
452 printf("child: pid=%d waiting for parent's ready...\n", getpid());
462 printf(" child: read_pipe failed\n");
468 printf("child: didn't proper ready message\n");
479 printf("child: releasing sig %d...\n", sig);
518 } /* end of child */
521 * setup_sigs() : set child up to catch all signals. If there is
550 * handler() : child's interrupt handler for all signals. The phase variable
551 * is set in the child process indicating what action is to be taken.
552 * The phase 1 section will be run if the child process catches a signal
554 * The parent detects this situation by a child exit value of SIG_CAUGHT.
555 * The phase 2 section will be run if the child process catches a
564 printf("child: handler phase%d: caught signal %d.\n", phase, sig);
568 /* exit the child process with a value of -1 */
768 /* set up pipe for parent/child communications */
779 /* set up pipe for parent/child communications */