summary refs log tree commit diff
path: root/ripple/minitrace
diff options
context:
space:
mode:
Diffstat (limited to 'ripple/minitrace')
-rw-r--r--ripple/minitrace/src/main.rs12
-rw-r--r--ripple/minitrace/src/syscall_abi/mod.rs15
2 files changed, 14 insertions, 13 deletions
diff --git a/ripple/minitrace/src/main.rs b/ripple/minitrace/src/main.rs
index 74bfee2..2983e57 100644
--- a/ripple/minitrace/src/main.rs
+++ b/ripple/minitrace/src/main.rs
@@ -297,18 +297,6 @@ fn check_syscall(entry: &SyscallEntry) -> bool {
 		SyscallEntry::mprotect { addr, len, prot: _ } => {
 			return addr % 4096 == 0 && len % 4096 == 0;
 		}
-		SyscallEntry::rt_sigaction {
-			sig: _,
-			act: _,
-			oact: _,
-			sigsetsize,
-		} => {
-			if sigsetsize != 8 {
-				panic!(
-					"rt_sigaction(2) sigsetsize should be sizeof (sigset_t), actually {sigsetsize}"
-				);
-			}
-		}
 		SyscallEntry::access { ref filename, mode } => {
 			println!("access({filename:?}, {mode:?})");
 		}
diff --git a/ripple/minitrace/src/syscall_abi/mod.rs b/ripple/minitrace/src/syscall_abi/mod.rs
index e0b35a9..6a84679 100644
--- a/ripple/minitrace/src/syscall_abi/mod.rs
+++ b/ripple/minitrace/src/syscall_abi/mod.rs
@@ -29,7 +29,7 @@ define_syscalls! {
 		fn mmap(addr: u64, len: u64, prot: ProtFlags, flags: MapFlags, fd: Option<FileDesc>, off: u64) -> i64 = 9;
 		fn mprotect(addr: u64, len: usize, prot: ProtFlags) -> i64 = 10;
 		fn brk(brk: u64) -> i64 = 12;
-		fn rt_sigaction(sig: Signal, act: *const SigAction, oact: *mut SigAction, sigsetsize: usize) -> i64 = 13;
+		fn rt_sigaction(sig: Signal, act: *const SigAction, oact: *mut SigAction, sigsetsize: SigSetSize) -> i64 = 13;
 		fn ioctl(fd: FileDesc, cmd: Ioctl, arg: u64) -> i64 = 16;
 		fn pread64(fd: FileDesc, buf: *mut u8, count: usize, pos: u64) -> i64 = 17;
 		fn access(filename: CString, mode: AccessMode) -> i64 = 21;
@@ -125,3 +125,16 @@ syscall_enums! {
 		SEGV = 11 => SIGSEGV,
 	}
 }
+
+#[derive(Debug, Copy, Clone)]
+pub(crate) struct SigSetSize;
+
+impl SyscallArg for SigSetSize {
+	fn try_from_reg(reg: u64) -> Option<Self> {
+		if reg == 8 {
+			Some(SigSetSize)
+		} else {
+			None
+		}
+	}
+}