Home | History | Annotate | Download | only in lib

Lines Matching defs:pid

145 // return: pid of child process
148 int cestnepasun[4], pid;
153 for (pid = 0; pid < 2; pid++) {
154 if (pipes[pid] == -1) continue;
155 if (pipe(cestnepasun+(2*pid))) perror_exit("pipe");
156 pipes[pid] = cestnepasun[pid+1];
161 if (!(pid = xfork())) {
195 return pid;
198 int xpclose_both(pid_t pid, int *pipes)
206 waitpid(pid, &rc, 0);
214 int pipes[2], pid;
218 pid = xpopen_both(argv, pipes);
219 *pipe = pid ? pipes[!!stdout] : -1;
221 return pid;
224 int xpclose(pid_t pid, int pipe)
228 return xpclose_both(pid, 0);
579 // Open a /var/run/NAME.pid file, dying if we can't write it or if it currently
585 pid_t pid;
587 sprintf(pidfile, "/var/run/%s.pid", name);
600 pid = atoi(spid);
601 if (pid < 1 || (kill(pid, 0) && errno == ESRCH)) unlink(pidfile);