about summary refs log tree commit diff
path: root/fs-tracer-common
diff options
context:
space:
mode:
authorBaitinq <manuelpalenzuelamerino@gmail.com>2024-01-31 00:25:30 +0100
committerBaitinq <manuelpalenzuelamerino@gmail.com>2024-01-31 00:25:30 +0100
commit050bc2c9690fd5932c83e8ed2750d5e4b72b5906 (patch)
tree25297ad01b1c4a5df84c443e2e34b135d8ad6bcc /fs-tracer-common
parentstart fetching pwd recursively (diff)
downloadfs-tracer-050bc2c9690fd5932c83e8ed2750d5e4b72b5906.tar.gz
fs-tracer-050bc2c9690fd5932c83e8ed2750d5e4b72b5906.tar.bz2
fs-tracer-050bc2c9690fd5932c83e8ed2750d5e4b72b5906.zip
cleanup
Diffstat (limited to 'fs-tracer-common')
-rw-r--r--fs-tracer-common/Cargo.toml2
-rw-r--r--fs-tracer-common/src/lib.rs12
2 files changed, 10 insertions, 4 deletions
diff --git a/fs-tracer-common/Cargo.toml b/fs-tracer-common/Cargo.toml
index 2600868..6fc97ca 100644
--- a/fs-tracer-common/Cargo.toml
+++ b/fs-tracer-common/Cargo.toml
@@ -9,6 +9,8 @@ user = ["aya"]
 
 [dependencies]
 aya = { git = "https://github.com/aya-rs/aya", optional = true }
+aya-bpf = { git = "https://github.com/aya-rs/aya" }
+
 
 [lib]
 path = "src/lib.rs"
diff --git a/fs-tracer-common/src/lib.rs b/fs-tracer-common/src/lib.rs
index 7ed6d66..4469128 100644
--- a/fs-tracer-common/src/lib.rs
+++ b/fs-tracer-common/src/lib.rs
@@ -1,7 +1,11 @@
 #![no_std]
+#![feature(c_size_t)]
 
+use core::ffi::c_uint;
 use core::fmt::{self, Formatter};
 use core::str;
+use aya_bpf::cty::c_long;
+use core::ffi::c_size_t;
 
 pub enum SyscallInfo {
     Write(WriteSyscallBPF),
@@ -10,11 +14,11 @@ pub enum SyscallInfo {
 #[derive(Clone, Copy)]
 pub struct WriteSyscallBPF {
     pub pid: u32,
-    pub fd: u64,
-    pub buf: [u8; 96],
-    pub count: u64,
+    pub fd: c_uint,
+    pub buf: [u8; 96], //TODO: might want to use c_char here
+    pub count: c_size_t,
 
-    pub ret: i64,
+    pub ret: c_long,
 }
 
 unsafe impl Sync for WriteSyscallBPF {}