bpf-link: Add HAVE_LIBBPF check

Fixes compilation error in userns-restrict.c where we try to include
libbpf.h when it is not available.
This commit is contained in:
Daan De Meyer
2025-05-16 21:36:15 +09:00
committed by Yu Watanabe
parent b2ef1818e6
commit 96b9d4162f
+4
View File
@@ -2,6 +2,8 @@
#pragma once
#if HAVE_LIBBPF
#include <stdio.h>
#include <bpf/libbpf.h>
@@ -17,3 +19,5 @@ DEFINE_TRIVIAL_CLEANUP_FUNC(struct bpf_link *, bpf_link_free);
struct ring_buffer* bpf_ring_buffer_free(struct ring_buffer *rb);
DEFINE_TRIVIAL_CLEANUP_FUNC(struct ring_buffer *, bpf_ring_buffer_free);
#endif