seccomp.h 743 B

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