Lines Matching defs:pid

117 	pid_t	pd_pid;			/* pid to add or remove */
130 pid_t pl_pid; /* pid to watch for */
167 static int proc_to_fd(); /* Takes a pid and returns an fd for its proc */
177 static int proc_is_alive(pid_t pid); /* Check if a process is alive */
371 pid_t pid;
414 (void) pread(WTMPXfd, (void *)&pid, sizeof (pid), 0);
492 dprintf(("Poll Err = %d pid = %d i = %d\n", \
495 pid = pidtable[i].pl_pid; /* Save pid for below */
505 add_pid(pid);
669 dprintf(("drain_pipe: Recd command %d, pid %d\n",
697 * add_pid - add a pid to the fd table and the pidtable.
702 add_pid(pid_t pid)
710 * Check to see if the pid is already in our table, or being passed
711 * pid zero.
713 if (pidcnt != 0 && (find_pid(pid, &j) == 1 || pid == 0))
729 if (pid != 0 && (fd = proc_to_fd(pid)) == -1) {
743 if (pid <= pidtable[i].pl_pid)
751 if (i != pidcnt && pid != pidtable[i].pl_pid) {
774 * Likewise, setup pid field and pointer (index) to the fdtable entry
776 pidtable[i].pl_pid = pid;
778 pidcnt++; /* Bump the pid count */
779 dprintf((" add_pid: pid = %d fd = %d index = %d pidcnt = %d\n",
780 (int)pid, fd, i, pidcnt));
787 * If i != -1 don't look up the pid, use i as index
789 * pid - Pid of process to clean or 0 if we don't know it
797 rem_pid(pid_t pid, int i, int clean_it)
801 dprintf((" rem_pid: pid = %d i = %d", (int)pid, i));
806 if ((i == -1 && pid == 0) || (i == 0)) {
811 if (i != -1 || find_pid(pid, &i) == 1) { /* Found the entry */
830 * decrement the pid count - one less pid to worry about
840 * find_pid - Returns an index into the pidtable of the specifed pid,
845 find_pid(pid_t pid, int *i)
850 pe.pl_pid = pid;
880 proc_to_fd(pid_t pid)
885 (void) sprintf(procname, "/proc/%d/psinfo", (int)pid);
948 * Find the entry that corresponds to this pid.
1049 proc_is_alive(pid_t pid)
1055 if (kill(pid, 0) != 0)
1061 (void) sprintf(psinfoname, "/proc/%d/psinfo", (int)pid);
1067 * read of the psinfo file failed, so pid is nonexistent.