Changeset View
Changeset View
Standalone View
Standalone View
head/sys/kern/subr_syscall.c
Show First 20 Lines • Show All 148 Lines • ▼ Show 20 Lines | if (__predict_false(sa->callp->sy_entry != 0)) | ||||
(*systrace_probe_func)(sa, SYSTRACE_ENTRY, 0); | (*systrace_probe_func)(sa, SYSTRACE_ENTRY, 0); | ||||
#endif | #endif | ||||
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_pflags &= ~TDP_NERRNO; | td->td_pflags &= ~TDP_NERRNO; | ||||
else | else | ||||
td->td_errno = error; | td->td_errno = error; | ||||
/* | |||||
* Note that some syscall implementations (e.g., sys_execve) | |||||
* will commit the audit record just before their final return. | |||||
* These were done under the assumption that nothing of interest | |||||
* would happen between their return and here, where we would | |||||
* normally commit the audit record. These assumptions will | |||||
* need to be revisited should any substantial logic be added | |||||
* above. | |||||
*/ | |||||
AUDIT_SYSCALL_EXIT(error, td); | AUDIT_SYSCALL_EXIT(error, td); | ||||
#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(sa->callp->sy_return != 0)) | if (__predict_false(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 | ||||
} else { | } else { | ||||
error = (sa->callp->sy_call)(td, sa->args); | error = (sa->callp->sy_call)(td, sa->args); | ||||
▲ Show 20 Lines • Show All 84 Lines • Show Last 20 Lines |