diff options
| -rw-r--r-- | tools/testing/selftests/seccomp/seccomp_bpf.c | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/tools/testing/selftests/seccomp/seccomp_bpf.c b/tools/testing/selftests/seccomp/seccomp_bpf.c index 4d6f92a9df6b..19cd272c234d 100644 --- a/tools/testing/selftests/seccomp/seccomp_bpf.c +++ b/tools/testing/selftests/seccomp/seccomp_bpf.c | |||
| @@ -6,10 +6,18 @@ | |||
| 6 | */ | 6 | */ |
| 7 | 7 | ||
| 8 | #include <sys/types.h> | 8 | #include <sys/types.h> |
| 9 | #include <asm/siginfo.h> | 9 | |
| 10 | #define __have_siginfo_t 1 | 10 | /* |
| 11 | #define __have_sigval_t 1 | 11 | * glibc 2.26 and later have SIGSYS in siginfo_t. Before that, |
| 12 | #define __have_sigevent_t 1 | 12 | * we need to use the kernel's siginfo.h file and trick glibc |
| 13 | * into accepting it. | ||
| 14 | */ | ||
| 15 | #if !__GLIBC_PREREQ(2, 26) | ||
| 16 | # include <asm/siginfo.h> | ||
| 17 | # define __have_siginfo_t 1 | ||
| 18 | # define __have_sigval_t 1 | ||
| 19 | # define __have_sigevent_t 1 | ||
| 20 | #endif | ||
| 13 | 21 | ||
| 14 | #include <errno.h> | 22 | #include <errno.h> |
| 15 | #include <linux/filter.h> | 23 | #include <linux/filter.h> |
| @@ -676,7 +684,7 @@ TEST_F_SIGNAL(TRAP, ign, SIGSYS) | |||
| 676 | syscall(__NR_getpid); | 684 | syscall(__NR_getpid); |
| 677 | } | 685 | } |
| 678 | 686 | ||
| 679 | static struct siginfo TRAP_info; | 687 | static siginfo_t TRAP_info; |
| 680 | static volatile int TRAP_nr; | 688 | static volatile int TRAP_nr; |
| 681 | static void TRAP_action(int nr, siginfo_t *info, void *void_context) | 689 | static void TRAP_action(int nr, siginfo_t *info, void *void_context) |
| 682 | { | 690 | { |
