Lines Matching refs:pid
63 pid_t pid;
81 child_find_by_pid(pid_t pid)
87 if (cp->pid == pid)
139 int pid, st;
148 if ((pid = fork1()) == -1) {
160 if (pid != 0) {
165 if (waitpid(pid, &st, 0) == pid && WIFEXITED(st))
415 int pid, fd = -1;
437 cp->pid = 0; /* update below */
461 if ((pid = fork1()) == -1) {
465 if (pid == 0) {
470 cp->pid = pid;
473 fprintf(stderr, "cmd_start: uid %d new iod, pid %d\n",
474 uid, pid);
514 pid_t pid;
519 while ((pid = waitpid(-1, &status, WNOHANG)) > 0) {
523 fprintf(stderr, "svc_sigchld: pid %d\n", (int)pid);
525 cp = child_find_by_pid(pid);
527 fprintf(stderr, "Unknown pid %d\n", (int)pid);
530 child_gone(cp->uid, cp->pid, status);
539 if (pid < 0 && err != ECHILD)
546 child_gone(uid_t uid, pid_t pid, int status)
552 fprintf(stderr, "child_gone: uid %d pid %d\n",
553 uid, (int)pid);
563 "uid %d, pid %d exit %d",
564 uid, (int)pid, x);
570 "uid %d, pid %d signal %d",
571 uid, (int)pid, x);
589 child_gone(cp->uid, cp->pid, 0);