Changeset View
Changeset View
Standalone View
Standalone View
sys/kern/kern_exit.c
Show First 20 Lines • Show All 302 Lines • ▼ Show 20 Lines | |||||
#ifdef AUDIT | #ifdef AUDIT | ||||
/* | /* | ||||
* The Sun BSM exit token contains two components: an exit status as | * The Sun BSM exit token contains two components: an exit status as | ||||
* passed to exit(), and a return value to indicate what sort of exit | * passed to exit(), and a return value to indicate what sort of exit | ||||
* it was. The exit status is WEXITSTATUS(rv), but it's not clear | * it was. The exit status is WEXITSTATUS(rv), but it's not clear | ||||
* what the return value is. | * what the return value is. | ||||
*/ | */ | ||||
AUDIT_ARG_EXIT(rval, 0); | AUDIT_ARG_EXIT(rval, 0); | ||||
AUDIT_SYSCALL_EXIT(0, td); | AUDIT_SYSCALL_EXIT(0, td); | ||||
aniketp: @asomers Don't we already have ` AUDIT_SYSCALL_EXIT(0, td)` here in the initial part of `exit1… | |||||
#endif | #endif | ||||
/* Are we a task leader with peers? */ | /* Are we a task leader with peers? */ | ||||
if (p->p_peers != NULL && p == p->p_leader) { | if (p->p_peers != NULL && p == p->p_leader) { | ||||
mtx_lock(&ppeers_lock); | mtx_lock(&ppeers_lock); | ||||
q = p->p_peers; | q = p->p_peers; | ||||
while (q != NULL) { | while (q != NULL) { | ||||
PROC_LOCK(q); | PROC_LOCK(q); | ||||
▲ Show 20 Lines • Show All 320 Lines • ▼ Show 20 Lines | #endif | ||||
* before we release the parent process' proc lock to avoid | * before we release the parent process' proc lock to avoid | ||||
* a lost wakeup. So, we first call wakeup, then we grab the | * a lost wakeup. So, we first call wakeup, then we grab the | ||||
* sched lock, update the state, and release the parent process' | * sched lock, update the state, and release the parent process' | ||||
* proc lock. | * proc lock. | ||||
*/ | */ | ||||
wakeup(p->p_pptr); | wakeup(p->p_pptr); | ||||
cv_broadcast(&p->p_pwait); | cv_broadcast(&p->p_pwait); | ||||
sched_exit(p->p_pptr, td); | sched_exit(p->p_pptr, td); | ||||
aniketpUnsubmitted Not Done Inline ActionsBtw, is this space intentional? It wasn't there before. aniketp: Btw, is this space intentional? It wasn't there before. | |||||
PROC_SLOCK(p); | PROC_SLOCK(p); | ||||
p->p_state = PRS_ZOMBIE; | p->p_state = PRS_ZOMBIE; | ||||
PROC_UNLOCK(p->p_pptr); | PROC_UNLOCK(p->p_pptr); | ||||
/* | /* | ||||
* Save our children's rusage information in our exit rusage. | * Save our children's rusage information in our exit rusage. | ||||
*/ | */ | ||||
PROC_STATLOCK(p); | PROC_STATLOCK(p); | ||||
▲ Show 20 Lines • Show All 709 Lines • Show Last 20 Lines |
@asomers Don't we already have AUDIT_SYSCALL_EXIT(0, td) here in the initial part of exit1()?