seccomp.h 790 B

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