Skip to content

Commit f055f35

Browse files
author
Alexei Starovoitov
committed
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 <[email protected]> Signed-off-by: Alexei Starovoitov <[email protected]>
1 parent 4170bc6 commit f055f35

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

tools/testing/selftests/bpf/prog_tests/test_local_storage.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@
1212
#include "local_storage.skel.h"
1313
#include "network_helpers.h"
1414

15+
#ifndef __NR_pidfd_open
16+
#define __NR_pidfd_open 434
17+
#endif
18+
1519
static inline int sys_pidfd_open(pid_t pid, unsigned int flags)
1620
{
1721
return syscall(__NR_pidfd_open, pid, flags);

0 commit comments

Comments
 (0)