Changeset View
Changeset View
Standalone View
Standalone View
sys/kern/subr_syscall.c
Show First 20 Lines • Show All 118 Lines • ▼ Show 20 Lines | #ifdef CAPABILITY_MODE | ||||
*/ | */ | ||||
if (__predict_false(IN_CAPABILITY_MODE(td) && | if (__predict_false(IN_CAPABILITY_MODE(td) && | ||||
!(sa->callp->sy_flags & SYF_CAPENABLED))) { | !(sa->callp->sy_flags & SYF_CAPENABLED))) { | ||||
td->td_errno = error = ECAPMODE; | td->td_errno = error = ECAPMODE; | ||||
goto retval; | goto retval; | ||||
} | } | ||||
#endif | #endif | ||||
error = syscall_thread_enter(td, sa->callp); | |||||
if (error != 0) { | |||||
td->td_errno = error; | |||||
goto retval; | |||||
} | |||||
/* | /* | ||||
* Fetch fast sigblock value at the time of syscall | * Fetch fast sigblock value at the time of syscall | ||||
* entry because sleepqueue primitives might call | * entry because sleepqueue primitives might call | ||||
* cursig(). | * cursig(). | ||||
*/ | */ | ||||
fetch_sigfastblock(td); | fetch_sigfastblock(td); | ||||
/* Let system calls set td_errno directly. */ | /* Let system calls set td_errno directly. */ | ||||
Show All 17 Lines | if (__predict_false(sa->callp->sy_return != 0)) | ||||
error ? -1 : td->td_retval[0]); | error ? -1 : td->td_retval[0]); | ||||
#endif | #endif | ||||
} else { | } else { | ||||
error = (sa->callp->sy_call)(td, sa->args); | error = (sa->callp->sy_call)(td, sa->args); | ||||
/* Save the latest error return value. */ | /* Save the latest error return value. */ | ||||
if (__predict_false((td->td_pflags & TDP_NERRNO) == 0)) | if (__predict_false((td->td_pflags & TDP_NERRNO) == 0)) | ||||
td->td_errno = error; | td->td_errno = error; | ||||
} | } | ||||
syscall_thread_exit(td, sa->callp); | |||||
retval: | retval: | ||||
KTR_STOP4(KTR_SYSC, "syscall", syscallname(p, sa->code), | KTR_STOP4(KTR_SYSC, "syscall", syscallname(p, sa->code), | ||||
(uintptr_t)td, "pid:%d", td->td_proc->p_pid, "error:%d", error, | (uintptr_t)td, "pid:%d", td->td_proc->p_pid, "error:%d", error, | ||||
"retval0:%#lx", td->td_retval[0], "retval1:%#lx", | "retval0:%#lx", td->td_retval[0], "retval1:%#lx", | ||||
td->td_retval[1]); | td->td_retval[1]); | ||||
if (__predict_false(traced)) { | if (__predict_false(traced)) { | ||||
PROC_LOCK(p); | PROC_LOCK(p); | ||||
▲ Show 20 Lines • Show All 74 Lines • Show Last 20 Lines |