samples: bpf: fix the compiling error
Subsystems (4)
PATCH 1/1 samples: bpf: fix the compiling error
From: Zhu Yanjun <[email protected]>
When compiling, the following error will appear.
"
samples/bpf//xdpsock_user.c:27:10: fatal error: sys/capability.h:
No such file or directory
"
Now capability.h is in linux directory.
--- samples/bpf/xdpsock_user.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
samples/bpf/xdpsock_user.c +1 -1
@@ -24,7 +24,7 @@#include <stdio.h> #include <stdlib.h> #include <string.h> -#include <sys/capability.h> +#include <linux/capability.h> #include <sys/mman.h> #include <sys/resource.h> #include <sys/socket.h>
Signature · 1 line
2.27.0
Quoted 9 lines · Zhu Yanjun
From: Zhu Yanjun <[email protected]>
When compiling, the following error will appear.
"
samples/bpf//xdpsock_user.c:27:10: fatal error:sys/capability.h:
No such file or directory
"
On my system, I get a compilation error if I include linux/capability.h as it does not have capget().
NAME
capget, capset - set/get capabilities of thread(s)
SYNOPSIS
#include <sys/capability.h>
int capget(cap_user_header_t hdrp, cap_user_data_t datap);Have you installed libcap? It contains the sys/capability.h header file that you need.
Quoted 24 lines
Now
capability.his in linux directory.Fixes 3627d9702d78 ("samples/bpf: Sample application for eBPF load and socket creation split")Signed-off-by Zhu Yanjun <[email protected]>--- samples/bpf/xdpsock_user.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)samples/bpf/xdpsock_user.c +1
-2@@ -24,7 +24,7 @@#include <stdio.h> #include <stdlib.h> #include <string.h> -#include <sys/capability.h> +#include <linux/capability.h> #include <sys/mman.h> #include <sys/resource.h> #include <sys/socket.h> --2.27.0
Quoted 7 lines · Magnus Karlsson
Quoted 5 lines · Zhu Yanjun
From: Zhu Yanjun <[email protected]>
When compiling, the following error will appear.
Quoted 7 lines
Quoted 4 lines
"
samples/bpf//xdpsock_user.c:27:10: fatal error:sys/capability.h:
No such file or directory
"On my system, I get a compilation error if I include
linux/capability.has it does not havecapget().
Thanks. Can you run "rpm -qf /xxx/xxx/sys/capability.h" to check which software provides sys/capability.h?
Now I am on CentOS Linux release 8.3.2011.
Thanks a lot.
Zhu Yanjun
Quoted 36 lines
NAME
capget, capset - set/get capabilities of thread(s)SYNOPSIS
#include <sys/capability.h> int capget(cap_user_header_t hdrp, cap_user_data_t datap);Have you installed libcap? It contains the
sys/capability.hheader file that you need.Quoted 24 lines
Now
capability.his in linux directory.Fixes 3627d9702d78 ("samples/bpf: Sample application for eBPF load and socket creation split")Signed-off-by Zhu Yanjun <[email protected]>--- samples/bpf/xdpsock_user.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)samples/bpf/xdpsock_user.c +1
-2@@ -24,7 +24,7 @@#include <stdio.h> #include <stdlib.h> #include <string.h> -#include <sys/capability.h> +#include <linux/capability.h> #include <sys/mman.h> #include <sys/resource.h> #include <sys/socket.h> --2.27.0
Quoted 15 lines · Zhu Yanjun
Quoted 12 lines · Magnus Karlsson
Quoted 9 lines · Zhu Yanjun
From: Zhu Yanjun <[email protected]>
When compiling, the following error will appear.
"
samples/bpf//xdpsock_user.c:27:10: fatal error:sys/capability.h:
No such file or directory
"
Quoted 6 lines
Quoted 2 lines
On my system, I get a compilation error if I include
linux/capability.has it does not havecapget().Thanks. Can you run "rpm -qf /xxx/xxx/sys/capability.h" to check which software provides
sys/capability.h?
Now I am on CentOS Linux release 8.3.2011.
I do not have CentOS, but it is likely called libcap-dev or libcap-devel. If that does not work, Google/Baidu it.
Quoted 40 lines
Thanks a lot.
Zhu YanjunQuoted 36 lines
NAME
capget, capset - set/get capabilities of thread(s)SYNOPSIS
#include <sys/capability.h> int capget(cap_user_header_t hdrp, cap_user_data_t datap);Have you installed libcap? It contains the
sys/capability.hheader file that you need.Quoted 24 lines
Now
capability.his in linux directory.Fixes 3627d9702d78 ("samples/bpf: Sample application for eBPF load and socket creation split")Signed-off-by Zhu Yanjun <[email protected]>--- samples/bpf/xdpsock_user.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)samples/bpf/xdpsock_user.c +1
-2@@ -24,7 +24,7 @@#include <stdio.h> #include <stdlib.h> #include <string.h> -#include <sys/capability.h> +#include <linux/capability.h> #include <sys/mman.h> #include <sys/resource.h> #include <sys/socket.h> --2.27.0
Quoted 20 lines · Magnus Karlsson
Quoted 18 lines · Zhu Yanjun
Quoted 14 lines · Magnus Karlsson
Quoted 9 lines · Zhu Yanjun
From: Zhu Yanjun <[email protected]>
When compiling, the following error will appear.
"
samples/bpf//xdpsock_user.c:27:10: fatal error:sys/capability.h:
No such file or directory
"On my system, I get a compilation error if I include
linux/capability.has it does not havecapget().
Quoted 6 lines
Quoted 3 lines
Thanks. Can you run "rpm -qf /xxx/xxx/sys/capability.h" to check which software provides
sys/capability.h?
Now I am on CentOS Linux release 8.3.2011.I do not have CentOS, but it is likely called libcap-dev or libcap-devel. If that does not work, Google/Baidu it.
Thanks. On centos8.3, libcap-devel can be installed by "dnf install libcap-devel".
Then this problem is fixed.
So please ignore this commit.
Zhu Yanjun
Quoted 41 lines
Quoted 41 lines
Thanks a lot.
Zhu YanjunQuoted 36 lines
NAME
capget, capset - set/get capabilities of thread(s)SYNOPSIS
#include <sys/capability.h> int capget(cap_user_header_t hdrp, cap_user_data_t datap);Have you installed libcap? It contains the
sys/capability.hheader file that you need.Quoted 24 lines
Now
capability.his in linux directory.Fixes 3627d9702d78 ("samples/bpf: Sample application for eBPF load and socket creation split")Signed-off-by Zhu Yanjun <[email protected]>--- samples/bpf/xdpsock_user.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)samples/bpf/xdpsock_user.c +1
-2@@ -24,7 +24,7 @@#include <stdio.h> #include <stdlib.h> #include <string.h> -#include <sys/capability.h> +#include <linux/capability.h> #include <sys/mman.h> #include <sys/resource.h> #include <sys/socket.h> --2.27.0