Skip to content

Commit 53f07b8

Browse files
jameshilliardNobody
authored and
Nobody
committed
libbpf: ensure F_DUPFD_CLOEXEC is defined
This definition seems to be missing from some older toolchains. Note that the fcntl.h in libbpf_internal.h is not a kernel header but rather a toolchain libc header. Fixes: libbpf_internal.h:521:18: error: 'F_DUPFD_CLOEXEC' undeclared (first use in this function); did you mean 'FD_CLOEXEC'? fd = fcntl(fd, F_DUPFD_CLOEXEC, 3); ^~~~~~~~~~~~~~~ FD_CLOEXEC Signed-off-by: James Hilliard <[email protected]>
1 parent ec441a1 commit 53f07b8

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

tools/lib/bpf/libbpf_internal.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,10 @@
3131
#define EM_BPF 247
3232
#endif
3333

34+
#ifndef F_DUPFD_CLOEXEC
35+
#define F_DUPFD_CLOEXEC 1030
36+
#endif
37+
3438
#ifndef R_BPF_64_64
3539
#define R_BPF_64_64 1
3640
#endif

0 commit comments

Comments
 (0)