subr_syscall.c (867099fa10ec5cb8a004ceac8d512a30912e3a04) | subr_syscall.c (2dd9ea6f702c2e5791dc34794f285426d6bfb1ca) |
---|---|
1/*- 2 * Copyright (C) 1994, David Greenman 3 * Copyright (c) 1990, 1993 4 * The Regents of the University of California. All rights reserved. 5 * Copyright (C) 2010 Konstantin Belousov <kib@freebsd.org> 6 * 7 * This code is derived from software contributed to Berkeley by 8 * the University of Utah, and William Jolitz. --- 122 unchanged lines hidden (view full) --- 131 sa->callp, sa->args, 0); 132#endif 133 134 AUDIT_SYSCALL_ENTER(sa->code, td); 135 error = (sa->callp->sy_call)(td, sa->args); 136 AUDIT_SYSCALL_EXIT(error, td); 137 138 /* Save the latest error return value. */ | 1/*- 2 * Copyright (C) 1994, David Greenman 3 * Copyright (c) 1990, 1993 4 * The Regents of the University of California. All rights reserved. 5 * Copyright (C) 2010 Konstantin Belousov <kib@freebsd.org> 6 * 7 * This code is derived from software contributed to Berkeley by 8 * the University of Utah, and William Jolitz. --- 122 unchanged lines hidden (view full) --- 131 sa->callp, sa->args, 0); 132#endif 133 134 AUDIT_SYSCALL_ENTER(sa->code, td); 135 error = (sa->callp->sy_call)(td, sa->args); 136 AUDIT_SYSCALL_EXIT(error, td); 137 138 /* Save the latest error return value. */ |
139 td->td_errno = error; | 139 if ((td->td_pflags & TDP_NERRNO) == 0) 140 td->td_errno = error; |
140 141#ifdef KDTRACE_HOOKS 142 /* 143 * If the systrace module has registered it's probe 144 * callback and if there is a probe active for the 145 * syscall 'return', process the probe. 146 */ 147 if (systrace_probe_func != NULL && sa->callp->sy_return != 0) --- 38 unchanged lines hidden (view full) --- 186 * Handle reschedule and other end-of-syscall issues 187 */ 188 userret(td, td->td_frame); 189 190 CTR4(KTR_SYSC, "syscall %s exit thread %p pid %d proc %s", 191 syscallname(p, sa->code), td, td->td_proc->p_pid, td->td_name); 192 193#ifdef KTRACE | 141 142#ifdef KDTRACE_HOOKS 143 /* 144 * If the systrace module has registered it's probe 145 * callback and if there is a probe active for the 146 * syscall 'return', process the probe. 147 */ 148 if (systrace_probe_func != NULL && sa->callp->sy_return != 0) --- 38 unchanged lines hidden (view full) --- 187 * Handle reschedule and other end-of-syscall issues 188 */ 189 userret(td, td->td_frame); 190 191 CTR4(KTR_SYSC, "syscall %s exit thread %p pid %d proc %s", 192 syscallname(p, sa->code), td, td->td_proc->p_pid, td->td_name); 193 194#ifdef KTRACE |
194 if (KTRPOINT(td, KTR_SYSRET)) 195 ktrsysret(sa->code, error, td->td_retval[0]); | 195 if (KTRPOINT(td, KTR_SYSRET)) { 196 ktrsysret(sa->code, (td->td_pflags & TDP_NERRNO) == 0 ? 197 error : td->td_errno, td->td_retval[0]); 198 } |
196#endif | 199#endif |
200 td->td_pflags &= ~TDP_NERRNO; |
|
197 198 if (p->p_flag & P_TRACED) { 199 traced = 1; 200 PROC_LOCK(p); 201 td->td_dbgflags |= TDB_SCX; 202 PROC_UNLOCK(p); 203 } else 204 traced = 0; --- 41 unchanged lines hidden --- | 201 202 if (p->p_flag & P_TRACED) { 203 traced = 1; 204 PROC_LOCK(p); 205 td->td_dbgflags |= TDB_SCX; 206 PROC_UNLOCK(p); 207 } else 208 traced = 0; --- 41 unchanged lines hidden --- |