mirror of
https://github.com/springzfx/cgproxy.git
synced 2026-02-09 21:14:57 +08:00
linux-headers needed fot bpf init
This commit is contained in:
@@ -59,9 +59,15 @@ void handle_events(void *cb_cookie, void *data, int data_size) {
|
||||
int execsnoop() {
|
||||
debug("starting execsnoop");
|
||||
ebpf::BPF bpf;
|
||||
auto init_res = bpf.init(BPF_PROGRAM);
|
||||
if (init_res.code() != 0) {
|
||||
std::cerr << init_res.msg() << std::endl;
|
||||
|
||||
try {
|
||||
auto init_res = bpf.init(BPF_PROGRAM);
|
||||
if (init_res.code() != 0) {
|
||||
std::cerr << init_res.msg() << std::endl;
|
||||
return 1;
|
||||
}
|
||||
} catch (exception &e) {
|
||||
error("bpf init failed, maybe linux-headers not installed: %s", e.what());
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user