diff options
author | Alexei Starovoitov <ast@kernel.org> | 2020-11-06 12:33:46 -0800 |
---|---|---|
committer | Alexei Starovoitov <ast@kernel.org> | 2020-11-06 12:33:46 -0800 |
commit | f055f355faf1991ef4e6b3c3517f8f2fc247805e (patch) | |
tree | 51454b700e4f63a57285fa3c173c68e7dcb656cf /tools | |
parent | 4170bc6baa5446e1d85e0b7647ea54ba72aa85c4 (diff) |
selftests/bpf: Fix selftest build with old libc
pidfd_open was added in 2019. Some versions of libc library don't define it.
Define it manually if it's not available.
Reported-by: Sergei Iudin <siudin@fb.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Diffstat (limited to 'tools')
-rw-r--r-- | tools/testing/selftests/bpf/prog_tests/test_local_storage.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/tools/testing/selftests/bpf/prog_tests/test_local_storage.c b/tools/testing/selftests/bpf/prog_tests/test_local_storage.c index 5fda45982be0..fcca7ba1f368 100644 --- a/tools/testing/selftests/bpf/prog_tests/test_local_storage.c +++ b/tools/testing/selftests/bpf/prog_tests/test_local_storage.c @@ -12,6 +12,10 @@ #include "local_storage.skel.h" #include "network_helpers.h" +#ifndef __NR_pidfd_open +#define __NR_pidfd_open 434 +#endif + static inline int sys_pidfd_open(pid_t pid, unsigned int flags) { return syscall(__NR_pidfd_open, pid, flags); |