FreeBSD/usr.sbin/jail/command.c
/*
 * Find the jail that corresponds to an exited process.
 */
Find the jail that corresponds to an exited process.
Find the jail that corresponds to an exited process .
static struct cfjail *
find_proc(pid_t pid)
{
	struct cfjail *j;
	struct phash *ph;
	LIST_FOREACH(ph, &phash[pid % PHASH_SIZE], le)
		if (ph->pid == pid) {
			j = ph->j;
			LIST_REMOVE(ph, le);
			free(ph);
			return --j->nprocs ? NULL : j;
		}
	return NULL;
}
static struct cfjail * find_proc ( pid_t pid ) { struct cfjail * j ; struct phash * ph ; LIST_FOREACH ( ph , & phash [ pid % PHASH_SIZE ] , le ) if ( ph -> pid == pid ) { j = ph -> j ; LIST_REMOVE ( ph , le ) ; free ( ph ) ; return -- j -> nprocs ? NULL : j ; } return NULL ; }
Find the jail that corresponds to an exited process.
Find the jail that corresponds to an exited process .