libminijail: Refactor `seccomp_filter_flags_available()`
This change creates a new function called
`seccomp_filter_flags_available()` so that it can also be called from
tests.
Bug: None
Test: make tests
Change-Id: Ie41ef0c7c457a39e4a46d5fcb6d6ff1dd29de890
diff --git a/syscall_wrapper.h b/syscall_wrapper.h
index ffdf707..7769108 100644
--- a/syscall_wrapper.h
+++ b/syscall_wrapper.h
@@ -3,4 +3,42 @@
* found in the LICENSE file.
*/
+#ifndef _SYSCALL_WRAPPER_H_
+#define _SYSCALL_WRAPPER_H_
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* Seccomp filter related flags. */
+#ifndef PR_SET_NO_NEW_PRIVS
+# define PR_SET_NO_NEW_PRIVS 38
+#endif
+
+#ifndef SECCOMP_MODE_FILTER
+#define SECCOMP_MODE_FILTER 2 /* Uses user-supplied filter. */
+#endif
+
+#ifndef SECCOMP_SET_MODE_STRICT
+# define SECCOMP_SET_MODE_STRICT 0
+#endif
+#ifndef SECCOMP_SET_MODE_FILTER
+# define SECCOMP_SET_MODE_FILTER 1
+#endif
+
+#ifndef SECCOMP_FILTER_FLAG_TSYNC
+# define SECCOMP_FILTER_FLAG_TSYNC 1
+#endif
+
+#ifndef SECCOMP_FILTER_FLAG_SPEC_ALLOW
+# define SECCOMP_FILTER_FLAG_SPEC_ALLOW (1 << 2)
+#endif
+/* End seccomp filter related flags. */
+
int sys_seccomp(unsigned int operation, unsigned int flags, void *args);
+
+#ifdef __cplusplus
+}; /* extern "C" */
+#endif
+
+#endif /* _SYSCALL_WRAPPER_H_ */