Changeset View
Changeset View
Standalone View
Standalone View
sys/kern/subr_syscall.c
Show First 20 Lines • Show All 119 Lines • ▼ Show 20 Lines | #ifdef CAPABILITY_MODE | ||||
*/ | */ | ||||
if (IN_CAPABILITY_MODE(td) && | if (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; | |||||
} | |||||
#ifdef KDTRACE_HOOKS | #ifdef KDTRACE_HOOKS | ||||
/* Give the syscall:::entry DTrace probe a chance to fire. */ | /* Give the syscall:::entry DTrace probe a chance to fire. */ | ||||
if (__predict_false(systrace_enabled && sa->callp->sy_entry != 0)) | if (__predict_false(systrace_enabled && sa->callp->sy_entry != 0)) | ||||
(*systrace_probe_func)(sa, SYSTRACE_ENTRY, 0); | (*systrace_probe_func)(sa, SYSTRACE_ENTRY, 0); | ||||
#endif | #endif | ||||
/* Let system calls set td_errno directly. */ | /* Let system calls set td_errno directly. */ | ||||
td->td_pflags &= ~TDP_NERRNO; | td->td_pflags &= ~TDP_NERRNO; | ||||
Show All 14 Lines | if ((td->td_pflags & TDP_NERRNO) == 0) | ||||
td->td_errno = error; | td->td_errno = error; | ||||
#ifdef KDTRACE_HOOKS | #ifdef KDTRACE_HOOKS | ||||
/* Give the syscall:::return DTrace probe a chance to fire. */ | /* Give the syscall:::return DTrace probe a chance to fire. */ | ||||
if (__predict_false(systrace_enabled && sa->callp->sy_return != 0)) | if (__predict_false(systrace_enabled && sa->callp->sy_return != 0)) | ||||
(*systrace_probe_func)(sa, SYSTRACE_RETURN, | (*systrace_probe_func)(sa, SYSTRACE_RETURN, | ||||
error ? -1 : td->td_retval[0]); | error ? -1 : td->td_retval[0]); | ||||
#endif | #endif | ||||
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 (traced) { | if (traced) { | ||||
PROC_LOCK(p); | PROC_LOCK(p); | ||||
▲ Show 20 Lines • Show All 73 Lines • Show Last 20 Lines |