Lines Matching defs:pid
59 struct pid {
60 SLIST_ENTRY(pid) next;
62 pid_t pid;
65 static SLIST_HEAD(, pid) pidlist = SLIST_HEAD_INITIALIZER(pidlist);
78 struct pid *cur, *p;
79 pid_t pid;
91 cur = malloc(sizeof(struct pid));
113 switch (pid = fork()) {
132 log_debugx("executing \"%s\" as pid %d", command, pid);
140 cur->pid = pid;
149 struct pid *cur, *last = NULL;
151 pid_t pid;
172 pid = wait4(cur->pid, &status, 0, NULL);
173 } while (pid == -1 && errno == EINTR);
176 log_warnx("\"%s\", pid %d, terminated with signal %d",
177 cur->command, pid, WTERMSIG(status));
182 log_warnx("\"%s\", pid %d, terminated with exit status %d",
183 cur->command, pid, WEXITSTATUS(status));
187 log_debugx("\"%s\", pid %d, terminated gracefully", cur->command, pid);
192 return (pid == -1 ? -1 : status);