seccomp: kill the seccomp_t typedef
[firefly-linux-kernel-4.4.55.git] / include / linux / seccomp.h
1 #ifndef _LINUX_SECCOMP_H
2 #define _LINUX_SECCOMP_H
3
4
5 #ifdef CONFIG_SECCOMP
6
7 #include <linux/thread_info.h>
8 #include <asm/seccomp.h>
9
10 struct seccomp {
11         int mode;
12 };
13
14 extern void __secure_computing(int);
15 static inline void secure_computing(int this_syscall)
16 {
17         if (unlikely(test_thread_flag(TIF_SECCOMP)))
18                 __secure_computing(this_syscall);
19 }
20
21 extern long prctl_get_seccomp(void);
22 extern long prctl_set_seccomp(unsigned long);
23
24 static inline int seccomp_mode(struct seccomp *s)
25 {
26         return s->mode;
27 }
28
29 #else /* CONFIG_SECCOMP */
30
31 #include <linux/errno.h>
32
33 struct seccomp { };
34
35 #define secure_computing(x) do { } while (0)
36
37 static inline long prctl_get_seccomp(void)
38 {
39         return -EINVAL;
40 }
41
42 static inline long prctl_set_seccomp(unsigned long arg2)
43 {
44         return -EINVAL;
45 }
46
47 static inline int seccomp_mode(struct seccomp *s)
48 {
49         return 0;
50 }
51
52 #endif /* CONFIG_SECCOMP */
53
54 #endif /* _LINUX_SECCOMP_H */