From f83a86d27a21fe501cb09565fd5768600e06c0aa 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 6acf18cc..1c518680 100644 --- a/runtime/syscall-server/syscall_context.cpp +++ b/runtime/syscall-server/syscall_context.cpp @@ -52,10 +52,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; @@ -72,7 +68,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