diff --git a/src/api/bpf.cpp b/src/api/bpf.cpp index 1f814256..78291f8a 100644 --- a/src/api/bpf.cpp +++ b/src/api/bpf.cpp @@ -855,7 +855,7 @@ void BPF::pin(const std::string &pathname, int fd) { )) syscall_error("BPF_OBJ_PIN"); } -auto BPF::get_pinned(const std::string &pathname) -> int { +auto BPF::get(const std::string &pathname) -> int { union bpf_attr attr; int fd = syscall_bpf( BPF_OBJ_GET, &attr, attr_size(file_flags), @@ -1011,6 +1011,11 @@ void BPF::pin(const std::string &pathname, int fd) { unsupported(); } +auto BPF::get(const std::string &pathname) -> int { + unsupported(); + return 0; +} + void BPF::attach(int attach_type, int fd) { unsupported(); } @@ -1241,7 +1246,7 @@ template<> void ClassDef::init() { Str *pathname; try { if (!ctx.arguments(1, &pathname)) return; - ret.set(BPF::get_pinned(pathname->str())); + ret.set(BPF::get(pathname->str())); } catch (std::runtime_error &err) { ctx.error(err); } diff --git a/src/api/bpf.hpp b/src/api/bpf.hpp index 38838fc9..854c776c 100644 --- a/src/api/bpf.hpp +++ b/src/api/bpf.hpp @@ -169,7 +169,7 @@ class Map : public pjs::ObjectTemplate { class BPF : public pjs::ObjectTemplate { public: static void pin(const std::string &pathname, int fd); - static auto get_pinned(const std::string &pathname) -> int; + static auto get(const std::string &pathname) -> int; static void attach(int attach_type, int fd); static void detach(int attach_type, int fd); static void attach(int attach_type, int fd, const std::string &cgroup);