I am ruing 16.04 LTS.
I am trying to compile the seccomp test program that is in the man page for seccomp. The test program is at the bottom of the man page http://man7.org/linux/man-pages/man2/seccomp.2.html
When I try to compile the program I get the following error message:
Code:
chen@consulting-VirtualBox:~/work/seccompTest$ gcc seccompTest.c
seccompTest.c: In function ‘install_filter’:
seccompTest.c:65:7: warning: implicit declaration of function ‘seccomp’ [-Wimplicit-function-declaration]
if (seccomp(SECCOMP_SET_MODE_FILTER, 0, &prog)) {
^
/tmp/cc5KwI6o.o: In function `install_filter':
seccompTest.c:(.text+0x108): undefined reference to `seccomp'
collect2: error: ld returned 1 exit status
Code:
if (seccomp(SECCOMP_SET_MODE_FILTER, 0, &prog)) {
perror("seccomp");
return 1;
}
I tried to fix this problem by downloading the kernel headers and modifying my build line to search for the headers properly. But this just seems to make the problem worse
Code:
chen@consulting-VirtualBox:~/work/seccompTest$ gcc -I/usr/src/linux-headers-4.4.0-34/include seccompTest.c
In file included from /usr/src/linux-headers-4.4.0-34/include/uapi/linux/capability.h:16:0,
from /usr/src/linux-headers-4.4.0-34/include/linux/capability.h:15,
from /usr/src/linux-headers-4.4.0-34/include/linux/sched.h:15,
from /usr/src/linux-headers-4.4.0-34/include/linux/audit.h:26,
from seccompTest.c:6:
/usr/src/linux-headers-4.4.0-34/include/linux/types.h:14:26: error: conflicting types for ‘fd_set’
typedef __kernel_fd_set fd_set;
^
In file included from /usr/include/x86_64-linux-gnu/sys/types.h:219:0,
from /usr/include/stdlib.h:314,
from seccompTest.c:4:
I'm pretty sure that I'm doing something silly wrong here. Just need some pointers to where to look.
برچسب: how to compile java,how to compile c,how to compile python,how to compile java in cmd,how to compile in eclipse,how to compile c, on mac,how to compile in visual studio,how to compile c, on windows,how to compile,how to compile a java program,
نویسنده: استخدام کار