]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
MFC 350012: Always set td_errno to the error value of a system call.
authorJohn Baldwin <jhb@FreeBSD.org>
Mon, 27 Apr 2020 04:47:02 +0000 (04:47 +0000)
committerJohn Baldwin <jhb@FreeBSD.org>
Mon, 27 Apr 2020 04:47:02 +0000 (04:47 +0000)
commit003b0231d38cbb3076ceb2ddb2e6d75e2385d9bb
treede86d70fac97ada11a7df931568a609e2039cd41
parentd6db8da3e07d0f0119dcc236af3f4cdffcf5d26a
MFC 350012: 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.

Compared to the original commit, this change preserves the ABI of
struct thread and instead adds explicit zero'ing of td_errno.
sys/compat/linux/linux_fork.c
sys/kern/kern_fork.c
sys/kern/kern_kthread.c
sys/kern/kern_thr.c
sys/kern/subr_syscall.c