summaryrefslogtreecommitdiff
path: root/src/shared/seccomp-util.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/shared/seccomp-util.c')
-rw-r--r--src/shared/seccomp-util.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/shared/seccomp-util.c b/src/shared/seccomp-util.c
index 8656d112b8..4667f508c7 100644
--- a/src/shared/seccomp-util.c
+++ b/src/shared/seccomp-util.c
@@ -21,6 +21,8 @@
#include <seccomp.h>
#include <stddef.h>
+#include "alloc-util.h"
+#include "fileio.h"
#include "macro.h"
#include "seccomp-util.h"
#include "string-util.h"
@@ -89,6 +91,14 @@ int seccomp_add_secondary_archs(scmp_filter_ctx *c) {
}
+bool is_seccomp_available(void) {
+ _cleanup_free_ char* field = NULL;
+ static int cached_enabled = -1;
+ if (cached_enabled < 0)
+ cached_enabled = get_proc_field("/proc/self/status", "Seccomp", "\n", &field) == 0;
+ return cached_enabled;
+}
+
const SystemCallFilterSet syscall_filter_sets[] = {
{
/* Clock */