seccomp.h 653 B

12345678910111213141516171819202122232425262728293031323334
  1. #ifndef _LINUX_SECCOMP_H
  2. #define _LINUX_SECCOMP_H
  3. #include <linux/config.h>
  4. #ifdef CONFIG_SECCOMP
  5. #define NR_SECCOMP_MODES 1
  6. #include <linux/thread_info.h>
  7. #include <asm/seccomp.h>
  8. typedef struct { int mode; } seccomp_t;
  9. extern void __secure_computing(int);
  10. static inline void secure_computing(int this_syscall)
  11. {
  12. if (unlikely(test_thread_flag(TIF_SECCOMP)))
  13. __secure_computing(this_syscall);
  14. }
  15. #else /* CONFIG_SECCOMP */
  16. #if (__GNUC__ > 2)
  17. typedef struct { } seccomp_t;
  18. #else
  19. typedef struct { int gcc_is_buggy; } seccomp_t;
  20. #endif
  21. #define secure_computing(x) do { } while (0)
  22. #endif /* CONFIG_SECCOMP */
  23. #endif /* _LINUX_SECCOMP_H */