I'm trying to see if I can use stdio.h with a simple XDP code that blocks every packet.
#include <linux/bpf.h>
#include <stdio.h>
int main()
{
return XDP_DROP;
}
This code works without stdio.h
but it wouldn't compile when I try to compile it using :
clang -target bpf -O2 -c xdp.c -o xdp.o
I was thinking maybe the compiler cannot find the system headers' directory so I also tried :
clang -target bpf -O2 -c xdp.c -o xdp.o -I /usr/include/
which I believe should specify where the system header files are.
I don't know what is wrong :(