Lines Matching refs:child

1 /*	$OpenBSD: child.c,v 1.28 2022/12/26 19:16:02 jmc Exp $	*/
54 * Structure for child rdist processes mainted by the parent
57 char *c_name; /* Name of child */
78 * Remove a child that has died (exited)
82 removechild(CHILD *child)
87 child->c_name, child->c_pid, child->c_readfd);
90 * Find the child in the list
94 if (pc == child)
98 error("RemoveChild called with bad child %s %d %d",
99 child->c_name, child->c_pid, child->c_readfd);
102 * Remove the child
117 (void) free(child->c_name);
119 (void) close(child->c_readfd);
127 * Create a totally new copy of a child.
130 copychild(CHILD *child)
136 newc->c_name = xstrdup(child->c_name);
137 newc->c_readfd = child->c_readfd;
138 newc->c_pid = child->c_pid;
139 newc->c_state = child->c_state;
146 * Add a child to the list of children.
149 addchild(CHILD *child)
155 pc = copychild(child);
163 child->c_name, child->c_pid, child->c_readfd, activechildren);
167 * Read input from a child process.
170 readchild(CHILD *child)
176 child->c_name, child->c_pid, child->c_readfd);
179 * Check that this is a valid child.
181 if (child->c_name == NULL || child->c_readfd <= 0) {
182 debugmsg(DM_MISC, "[readchild(%s, %d, %d) bad child]",
183 child->c_name, child->c_pid, child->c_readfd);
188 * Read from child and display the result.
190 while ((amt = read(child->c_readfd, rbuf, sizeof(rbuf))) > 0) {
193 child->c_name, child->c_pid, child->c_readfd, amt);
198 child->c_name, child->c_pid, child->c_readfd);
202 child->c_name, child->c_pid, child->c_readfd, amt, errno);
209 child->c_name, child->c_pid, child->c_readfd);
250 * input and then remove the child from the list of children.
263 * Reap every child that has exited. Break out of the
277 * See if a child really exited
308 * Scan the children list to find the child that just exited,
400 * Go through the list of children and read from each child
405 * Make sure child still exists
444 * Spawn (create) a new child process for "cmd".
460 error("Cannot spawn child for %s: fork failed: %s",
469 /* Receive notification when the child exits */
472 /* Setup the new child */
479 /* We're not going to write to the child */
488 /* Add new child to child list */
495 "spawn() Forked child %d for host %s active = %d\n",