aboutsummaryrefslogtreecommitdiff
path: root/sys/sys/proc.h
diff options
context:
space:
mode:
authorJohn Baldwin <jhb@FreeBSD.org>2019-07-15 21:16:01 +0000
committerJohn Baldwin <jhb@FreeBSD.org>2019-07-15 21:16:01 +0000
commit1af9474b2608696269c52a7dd77c54c9fae615d9 (patch)
tree1a6b83193c7c141c0dab56b0da8c917f73b40e4c /sys/sys/proc.h
parent8a3cfbff92b3dced3cde69af4bced05f56f3f5ee (diff)
downloadsrc-1af9474b2608696269c52a7dd77c54c9fae615d9.tar.gz
src-1af9474b2608696269c52a7dd77c54c9fae615d9.zip
Always set td_errno to the error value of a system call.
Early errors prior to a system call did not set td_errno. This commit sets td_errno for all errors during syscallenter(). As a result, syscallret() can now always use td_errno without checking TDP_NERRNO. Reviewed by: kib MFC after: 1 month Sponsored by: DARPA Differential Revision: https://reviews.freebsd.org/D20898
Notes
Notes: svn path=/head/; revision=350012
Diffstat (limited to 'sys/sys/proc.h')
-rw-r--r--sys/sys/proc.h3
1 files changed, 1 insertions, 2 deletions
diff --git a/sys/sys/proc.h b/sys/sys/proc.h
index 857bb5234d12..54728697b945 100644
--- a/sys/sys/proc.h
+++ b/sys/sys/proc.h
@@ -303,6 +303,7 @@ struct thread {
void *td_su; /* (k) FFS SU private */
sbintime_t td_sleeptimo; /* (t) Sleep timeout. */
int td_rtcgen; /* (s) rtc_generation of abs. sleep */
+ int td_errno; /* (k) Error from last syscall. */
size_t td_vslock_sz; /* (k) amount of vslock-ed space */
struct kcov_info *td_kcov_info; /* (*) Kernel code coverage data */
#define td_endzero td_sigmask
@@ -353,8 +354,6 @@ struct thread {
struct kaudit_record *td_ar; /* (k) Active audit record, if any. */
struct lpohead td_lprof[2]; /* (a) lock profiling objects. */
struct kdtrace_thread *td_dtrace; /* (*) DTrace-specific data. */
- int td_errno; /* Error returned by last syscall. */
- /* LP64 hole */
struct vnet *td_vnet; /* (k) Effective vnet. */
const char *td_vnet_lpush; /* (k) Debugging vnet push / pop. */
struct trapframe *td_intr_frame;/* (k) Frame of the current irq */