Commit e4e211cd authored by Andrii Nakryiko's avatar Andrii Nakryiko Committed by Treehugger Robot
Browse files

UPSTREAM: libbpf: Call memfd_create() syscall directly

Some versions of Android do not implement memfd_create() wrapper in
their libc implementation, leading to build failures ([0]). On the other
hand, memfd_create() is available as a syscall on quite old kernels
(3.17+, while bpf() syscall itself is available since 3.18+), so it is
ok to assume that syscall availability and call into it with syscall()
helper to avoid Android-specific workarounds.

Validated in libbpf-bootstrap's CI ([1]).

  [0] https://github.com/libbpf/libbpf-bootstrap/actions/runs/7701003207/job/20986080319#step:5:83
  [1] https://github.com/libbpf/libbpf-bootstrap/actions/runs/7715988887/job/21031767212?pr=253



Fixes: dac645b9 ("libbpf: use stable map placeholder FDs")
Signed-off-by: default avatarAndrii Nakryiko <andrii@kernel.org>
Signed-off-by: default avatarDaniel Borkmann <daniel@iogearbox.net>
Acked-by: default avatarEduard Zingerman <eddyz87@gmail.com>
Link: https://lore.kernel.org/bpf/20240201172027.604869-2-andrii@kernel.org


(cherry picked from commit 9fa5e1a1)
[Lee: Backported to solve implicit declaration of memfd_create() build issue]
Signed-off-by: default avatarLee Jones <joneslee@google.com>
Change-Id: I3694a2a7909666e8e76577628aab08150e972d56
parent 874c5214
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment