diff options
| author | Baitinq <[email protected]> | 2024-01-27 19:05:03 +0100 |
|---|---|---|
| committer | Baitinq <[email protected]> | 2024-01-27 19:05:03 +0100 |
| commit | 29a4bd062a45f57b52d3724477af12d964e0c9ef (patch) | |
| tree | a2e404ae9b817d543e674f3053babe675c4f1d96 /fs-tracer-ebpf/src/syscalls/write.rs | |
| parent | Continue (diff) | |
| download | fs-tracer-29a4bd062a45f57b52d3724477af12d964e0c9ef.tar.gz fs-tracer-29a4bd062a45f57b52d3724477af12d964e0c9ef.tar.bz2 fs-tracer-29a4bd062a45f57b52d3724477af12d964e0c9ef.zip | |
Use sharedCpuArray for buf
Diffstat (limited to '')
| -rw-r--r-- | fs-tracer-ebpf/src/syscalls/write.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/fs-tracer-ebpf/src/syscalls/write.rs b/fs-tracer-ebpf/src/syscalls/write.rs index b204b45..28ea858 100644 --- a/fs-tracer-ebpf/src/syscalls/write.rs +++ b/fs-tracer-ebpf/src/syscalls/write.rs @@ -1,13 +1,13 @@ use crate::*; -pub fn handle_sys_write(ctx: TracePointContext, syscall_type: SyscallType) -> Result<u32, u32> { +pub fn handle_sys_write(ctx: TracePointContext, syscall_type: SyscallType) -> Result<c_long, c_long> { match syscall_type { SyscallType::Enter => unsafe { handle_sys_write_enter(ctx) }, SyscallType::Exit => unsafe { handle_sys_write_exit(ctx) }, } } -unsafe fn handle_sys_write_enter(ctx: TracePointContext) -> Result<u32, u32> { +unsafe fn handle_sys_write_enter(ctx: TracePointContext) -> Result<c_long, c_long> { // info!(&ctx, "handle_sys_write start"); #[derive(Clone, Copy)] struct WriteSyscallArgs { @@ -45,7 +45,7 @@ unsafe fn handle_sys_write_enter(ctx: TracePointContext) -> Result<u32, u32> { Ok(0) } -unsafe fn handle_sys_write_exit(ctx: TracePointContext) -> Result<u32, u32> { +unsafe fn handle_sys_write_exit(ctx: TracePointContext) -> Result<c_long, c_long> { //info!(&ctx, "handle_sys_write_exit start"); let ret = *ptr_at::<i64>(&ctx, 16).unwrap_unchecked(); //TODO: We cant use unwrap, thats why we couldnt use the aya helper fns |