selftests/bpf: Use sys_pidfd_open() helper when possible
authorHou Tao <houtao1@huawei.com>
Tue, 11 Oct 2022 07:12:49 +0000 (15:12 +0800)
committerAndrii Nakryiko <andrii@kernel.org>
Thu, 13 Oct 2022 19:09:19 +0000 (12:09 -0700)
commit62c69e89e81bfbdb9a87ae3e0599dcc6aacf786b
treef3fd7ad771f817ed752b19f95481a4b903d9d694
parente94e0a2d3730cd718a3a67682b038b05fa40d2a7
selftests/bpf: Use sys_pidfd_open() helper when possible

SYS_pidfd_open may be undefined for old glibc, so using sys_pidfd_open()
helper defined in task_local_storage_helpers.h instead to fix potential
build failure.

And according to commit 7615d9e1780e ("arch: wire-up pidfd_open()"), the
syscall number of pidfd_open is always 434 except for alpha architure,
so update the definition of __NR_pidfd_open accordingly.

Signed-off-by: Hou Tao <houtao1@huawei.com>
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Link: https://lore.kernel.org/bpf/20221011071249.3471760-1-houtao@huaweicloud.com
tools/testing/selftests/bpf/prog_tests/bpf_iter.c
tools/testing/selftests/bpf/task_local_storage_helpers.h