aboutsummaryrefslogtreecommitdiff
path: root/sys/sys/procctl.h
diff options
context:
space:
mode:
authorKonstantin Belousov <kib@FreeBSD.org>2016-09-21 08:23:33 +0000
committerKonstantin Belousov <kib@FreeBSD.org>2016-09-21 08:23:33 +0000
commit643f6f47fd57742a2cdf8ef393105403eb8cb01c (patch)
treee282ef0e4838622734297617171e0db04756ae9b /sys/sys/procctl.h
parent5271129cd6573dfd9bbd433cb94f40a6bedcafaf (diff)
downloadsrc-643f6f47fd57742a2cdf8ef393105403eb8cb01c.tar.gz
src-643f6f47fd57742a2cdf8ef393105403eb8cb01c.zip
Add PROC_TRAPCAP procctl(2) controls and global sysctl kern.trap_enocap.
Both can be used to cause processes in capability mode to receive SIGTRAP when ENOTCAPABLE or ECAPMODE errors are returned from syscalls. Idea by: emaste Reviewed by: oshogbo (previous version), emaste Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D7965
Notes
Notes: svn path=/head/; revision=306081
Diffstat (limited to 'sys/sys/procctl.h')
-rw-r--r--sys/sys/procctl.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/sys/sys/procctl.h b/sys/sys/procctl.h
index c6f1e94eb5b7..8d0afc280495 100644
--- a/sys/sys/procctl.h
+++ b/sys/sys/procctl.h
@@ -43,6 +43,8 @@
#define PROC_REAP_KILL 6 /* kill descendants */
#define PROC_TRACE_CTL 7 /* en/dis ptrace and coredumps */
#define PROC_TRACE_STATUS 8 /* query tracing status */
+#define PROC_TRAPCAP_CTL 9 /* trap capability errors */
+#define PROC_TRAPCAP_STATUS 10 /* query trap capability status */
/* Operations for PROC_SPROTECT (passed in integer arg). */
#define PPROT_OP(x) ((x) & 0xf)
@@ -102,6 +104,9 @@ struct procctl_reaper_kill {
#define PROC_TRACE_CTL_DISABLE 2
#define PROC_TRACE_CTL_DISABLE_EXEC 3
+#define PROC_TRAPCAP_CTL_ENABLE 1
+#define PROC_TRAPCAP_CTL_DISABLE 2
+
#ifndef _KERNEL
__BEGIN_DECLS
int procctl(idtype_t, id_t, int, void *);