[PATCH bpf-next 01/14] bpftool: fix unistd.h include

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



cgroup.c in bpftool source code is defining _XOPEN_SOURCE 500, which,
apparently, makes syscall() unavailable. Which is a problem now that
libbpf exposes syscal()-usign bpf() API in bpf.h.

Fix by defining _GNU_SOURCE instead, which enables syscall() wrapper.

Signed-off-by: Andrii Nakryiko <andrii@xxxxxxxxxx>
---
 tools/bpf/bpftool/cgroup.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/bpf/bpftool/cgroup.c b/tools/bpf/bpftool/cgroup.c
index 3571a281c43f..4876364e753d 100644
--- a/tools/bpf/bpftool/cgroup.c
+++ b/tools/bpf/bpftool/cgroup.c
@@ -2,7 +2,7 @@
 // Copyright (C) 2017 Facebook
 // Author: Roman Gushchin <guro@xxxxxx>
 
-#define _XOPEN_SOURCE 500
+#define _GNU_SOURCE
 #include <errno.h>
 #include <fcntl.h>
 #include <ftw.h>
-- 
2.30.2




[Index of Archives]     [Linux Samsung SoC]     [Linux Rockchip SoC]     [Linux Actions SoC]     [Linux for Synopsys ARC Processors]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]


  Powered by Linux