Skip to content

Commit

Permalink
remove new syscall variable
Browse files Browse the repository at this point in the history
  • Loading branch information
hp77-creator committed Aug 30, 2024
1 parent 7421110 commit f83a86d
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions runtime/syscall-server/syscall_context.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<decltype(&::syscall)>(dlsym(libc_handle, "syscall"));

static inline __u64 ptr_to_u64(const void *ptr)
{
return (__u64) (unsigned long) ptr;
Expand All @@ -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
Expand Down

0 comments on commit f83a86d

Please sign in to comment.