From 962508ad9febf41f45010f5f612bb102f662b83c Mon Sep 17 00:00:00 2001 From: Himanshu Pandey <24816726+hp77-creator@users.noreply.github.com> Date: Fri, 30 Aug 2024 08:03:47 +0530 Subject: [PATCH] remove new syscall variable --- runtime/syscall-server/syscall_context.cpp | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) 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