aboutsummaryrefslogtreecommitdiff
path: root/sys/sys/errno.h
diff options
context:
space:
mode:
authorJohn Baldwin <jhb@FreeBSD.org>2016-10-01 22:08:07 +0000
committerJohn Baldwin <jhb@FreeBSD.org>2016-10-01 22:08:07 +0000
commit406d2926f28831429a93083bf1b09634e8cad72a (patch)
tree520ad12df122f2b81590cb2ec0c72ff1da3ff705 /sys/sys/errno.h
parent8dec694290a38bc1ba64152a574350d70884afb4 (diff)
downloadsrc-406d2926f28831429a93083bf1b09634e8cad72a.tar.gz
src-406d2926f28831429a93083bf1b09634e8cad72a.zip
Expose kernel-only errno values if _WANT_KERNEL_ERRNO is defined.
The kernel uses a few negative errno values for internal conditions such as requesting a system call restart. Normally these errno values are not exposed to userland. However, kdump needs access to these values as some of then can be present in a ktrace system call return record. Previously kdump was defining _KERNEL to gain access to ehse values, but was then having to manually declare 'errno' (and doing it incorrectly). Now, kdump uses _WANT_KERNEL_ERRNO instead of _KERNEL and uses the system-provided declaration of errno.
Notes
Notes: svn path=/head/; revision=306564
Diffstat (limited to 'sys/sys/errno.h')
-rw-r--r--sys/sys/errno.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/sys/sys/errno.h b/sys/sys/errno.h
index 52efd3193a0e..b6056d2f4cb0 100644
--- a/sys/sys/errno.h
+++ b/sys/sys/errno.h
@@ -184,7 +184,7 @@ __END_DECLS
#define ELAST 96 /* Must be equal largest errno */
#endif /* _POSIX_SOURCE */
-#ifdef _KERNEL
+#if defined(_KERNEL) || defined(_WANT_KERNEL_ERRNO)
/* pseudo-errors returned inside kernel to modify return to process */
#define ERESTART (-1) /* restart syscall */
#define EJUSTRETURN (-2) /* don't modify regs, just return */