Open milahu opened 3 years ago
related:
hook! {
unsafe fn syscall(
// ...
) -> libc::c_long => my_syscall {
// ...
let buf_len = real!(readlink)(path, buf, bufsiz);
// error: readlink not found in this scope
// this works
let buf_len = real!(syscall)(
libc::SYS_readlink,
path as *mut libc::c_void,
buf as *mut libc::c_void,
bufsiz as *mut libc::c_void,
std::ptr::null_mut() as *mut libc::c_void,
std::ptr::null_mut() as *mut libc::c_void
);
}
readlink
is only available when i add
hook! {
unsafe fn readlink(
// ...
) -> ... => my_readlink {
// ...
real!(readlink)(path, buf, bufsiz);
}
i want to intercept the
statx
call by node. problem is, instead ofstatx(...)
, node callssyscall(332, ...)
node/deps/uv/src/unix/linux-syscalls.c
currently i use this code to trap syscalls
maybe solve this with macros?
related: https://docs.rs/syscalls/0.4.2/syscalls/macro.syscall_args.html