diff options
Diffstat (limited to 'ripple/minitrace')
-rw-r--r-- | ripple/minitrace/src/main.rs | 6 | ||||
-rw-r--r-- | ripple/minitrace/src/syscall_abi/mod.rs | 15 |
2 files changed, 14 insertions, 7 deletions
diff --git a/ripple/minitrace/src/main.rs b/ripple/minitrace/src/main.rs index 2983e57..19be3f2 100644 --- a/ripple/minitrace/src/main.rs +++ b/ripple/minitrace/src/main.rs @@ -341,12 +341,6 @@ fn check_syscall(entry: &SyscallEntry) -> bool { } } } - SyscallEntry::set_robust_list { head: _, len } => { - if len != 24 { - panic!("set_robust_list(2) len should be sizeof (struct robust_list_head), actually {len}"); - } - println!("set_robust_list(..)"); - } SyscallEntry::prlimit64 { pid, resource: _, diff --git a/ripple/minitrace/src/syscall_abi/mod.rs b/ripple/minitrace/src/syscall_abi/mod.rs index 6a84679..c274d0b 100644 --- a/ripple/minitrace/src/syscall_abi/mod.rs +++ b/ripple/minitrace/src/syscall_abi/mod.rs @@ -42,7 +42,7 @@ define_syscalls! { fn exit_group(error_code: i32) -> i64 = 231; fn openat(dfd: DirFd, filename: CString, flags: OpenFlags, mode: FileMode) -> i64 = 257; fn newfstatat(dfd: DirFd, filename: CString, statbuf: *mut Stat, flags: AtFlags) -> i64 = 262; - fn set_robust_list(head: *mut RobustListHead, len: usize) -> i64 = 273; + fn set_robust_list(head: *mut RobustListHead, len: RobustListHeadSize) -> i64 = 273; fn prlimit64(pid: i32, resource: ResourceLimit, new_rlim: *const RLimit64, old_rlim: *mut RLimit64) -> i64 = 302; fn getrandom(ubuf: *mut u8, len: usize, flags: GrndFlags) -> i64 = 318; } @@ -138,3 +138,16 @@ impl SyscallArg for SigSetSize { } } } + +#[derive(Debug, Copy, Clone)] +pub(crate) struct RobustListHeadSize; + +impl SyscallArg for RobustListHeadSize { + fn try_from_reg(reg: u64) -> Option<Self> { + if reg == 24 { + Some(RobustListHeadSize) + } else { + None + } + } +} |