summaryrefslogtreecommitdiff
path: root/tools/testing/selftests/bpf/prog_tests/test_local_storage.c
diff options
context:
space:
mode:
authorHou Tao <houtao1@huawei.com>2022-09-01 09:19:37 +0300
committerMartin KaFai Lau <martin.lau@kernel.org>2022-09-01 22:16:20 +0300
commitc710136e87747f1cc8e24948b3046ee57a1fe2eb (patch)
treea03e61d0319ebbbdf55993fd4973edb286e800ab /tools/testing/selftests/bpf/prog_tests/test_local_storage.c
parentc89e843a11f1075d27684f6b42256213e4592383 (diff)
downloadlinux-c710136e87747f1cc8e24948b3046ee57a1fe2eb.tar.xz
selftests/bpf: Move sys_pidfd_open() into task_local_storage_helpers.h
sys_pidfd_open() is defined twice in both test_bprm_opts.c and test_local_storage.c, so move it to a common header file. And it will be used in map_tests as well. Signed-off-by: Hou Tao <houtao1@huawei.com> Acked-by: Alexei Starovoitov <ast@kernel.org> Link: https://lore.kernel.org/r/20220901061938.3789460-4-houtao@huaweicloud.com Signed-off-by: Martin KaFai Lau <martin.lau@kernel.org>
Diffstat (limited to 'tools/testing/selftests/bpf/prog_tests/test_local_storage.c')
-rw-r--r--tools/testing/selftests/bpf/prog_tests/test_local_storage.c10
1 files changed, 1 insertions, 9 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 26ac26a88026..9c77cd6b1eaf 100644
--- a/tools/testing/selftests/bpf/prog_tests/test_local_storage.c
+++ b/tools/testing/selftests/bpf/prog_tests/test_local_storage.c
@@ -11,15 +11,7 @@
#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);
-}
+#include "task_local_storage_helpers.h"
static unsigned int duration;