diff --git a/runtime/syscall-server/syscall_context.cpp b/runtime/syscall-server/syscall_context.cpp index e06c762b..bfa4a326 100644 --- a/runtime/syscall-server/syscall_context.cpp +++ b/runtime/syscall-server/syscall_context.cpp @@ -55,10 +55,6 @@ #if __linux__ && !BPFTIME_BUILD_WITH_LIBBPF #define offsetofend(type, member) (offsetof(type, member) + sizeof(((type *)0)->member)) -static void *libc_handle = dlopen(LIBC_SO, RTLD_LAZY); -static auto libc_syscall = - reinterpret_cast(dlsym(libc_handle, "syscall")); - static inline __u64 ptr_to_u64(const void *ptr) { return (__u64) (unsigned long) ptr; @@ -75,7 +71,7 @@ inline int bpf_obj_get_info_by_fd(int bpf_fd, void *info, __u32 *info_len) attr.info.info_len = *info_len; attr.info.info = ptr_to_u64(info); - err = libc_syscall(__NR_bpf, BPF_OBJ_GET_INFO_BY_FD, &attr, attr_sz); + err = this->orig_syscall_fn(__NR_bpf, BPF_OBJ_GET_INFO_BY_FD, &attr, attr_sz); if (!err) *info_len = attr.info.info_len; // no-op stub