seccomp.h 769 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  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. #include <linux/errno.h>
  17. typedef struct { } seccomp_t;
  18. #define secure_computing(x) do { } while (0)
  19. static inline long prctl_get_seccomp(void)
  20. {
  21. return -EINVAL;
  22. }
  23. static inline long prctl_set_seccomp(unsigned long arg2)
  24. {
  25. return -EINVAL;
  26. }
  27. #endif /* CONFIG_SECCOMP */
  28. #endif /* _LINUX_SECCOMP_H */