mirror of
https://github.com/torvalds/linux
synced 2024-07-21 10:41:44 +00:00
libbpf: Define MFD_CLOEXEC if not available
Since its going directly to the syscall to avoid not having
memfd_create() available in some systems, do the same for its
MFD_CLOEXEC flags, defining it if not available.
This fixes the build in those systems, noticed while building perf on a
set of build containers.
Fixes: 9fa5e1a180
("libbpf: Call memfd_create() syscall directly")
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Link: https://lore.kernel.org/bpf/ZfxZ9nCyKvwmpKkE@x1
This commit is contained in:
parent
a51cd6bf8e
commit
ddb2ffdc47
|
@ -1650,6 +1650,10 @@ static int sys_memfd_create(const char *name, unsigned flags)
|
|||
return syscall(__NR_memfd_create, name, flags);
|
||||
}
|
||||
|
||||
#ifndef MFD_CLOEXEC
|
||||
#define MFD_CLOEXEC 0x0001U
|
||||
#endif
|
||||
|
||||
static int create_placeholder_fd(void)
|
||||
{
|
||||
int fd;
|
||||
|
|
Loading…
Reference in a new issue