Skip to content

Commit

Permalink
selftests/bpf: Fix selftest build with old libc
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Alexei Starovoitov committed Nov 6, 2020
1 parent 4170bc6 commit f055f35
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions tools/testing/selftests/bpf/prog_tests/test_local_storage.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit f055f35

Please sign in to comment.