diff options
author | V <v@unfathomable.blue> | 2022-06-17 06:41:21 +0200 |
---|---|---|
committer | V <v@unfathomable.blue> | 2022-06-17 06:42:48 +0200 |
commit | 1f337530756e0fa5e95df6a093504b8c834679a6 (patch) | |
tree | b4f0a2c122639ad171aa4715938605a9bf793c63 | |
parent | 5ee0ef925cbbf331052f72fb7c7a15e9f426fbb5 (diff) | |
download | unf-legacy-1f337530756e0fa5e95df6a093504b8c834679a6.tar.zst |
ripple/minitrace: add set_tid_address, set_robust_list, and getrandom
With this, minitrace has all the syscalls needed to run cc1. Change-Id: Iaeef58769f69d64e192af2270eb520e891daec94
-rw-r--r-- | ripple/minitrace/src/main.rs | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/ripple/minitrace/src/main.rs b/ripple/minitrace/src/main.rs index bc22563..3f0041f 100644 --- a/ripple/minitrace/src/main.rs +++ b/ripple/minitrace/src/main.rs @@ -273,6 +273,12 @@ fn check_syscall(process: &Process, entry: SyscallEntry) -> bool { } } + // set_tid_address + 218 => { + let [_tidptr, ..] = entry.args; + println!("set_tid_address(..)"); + } + // exit_group 231 => {} @@ -305,6 +311,15 @@ fn check_syscall(process: &Process, entry: SyscallEntry) -> bool { println!("newfstatat(AT_FDCWD, {:?}, ..)", pathname); } + // set_robust_list + 273 => { + let [_head, len, ..] = entry.args; + if len != 24 { + panic!("set_robust_list(2) len should be sizeof (struct robust_list_head), actually {}", len); + } + println!("set_robust_list(..)"); + } + // prlimit64 302 => { let [pid, resource, _new_limit, _old_limit, ..] = entry.args; @@ -319,6 +334,16 @@ fn check_syscall(process: &Process, entry: SyscallEntry) -> bool { } } + // getrandom + 318 => { + let [_buf, buflen, flags, ..] = entry.args; + let flags = flags + .try_into() + .expect("getrandom(2) flags don't fit in u32"); + let flags = GrndFlags::from_bits(flags).expect("unknown getrandom(2) flags"); + println!("getrandom(.., {}, {:?})", buflen, flags); + } + _ => return false, } true @@ -332,4 +357,9 @@ bitflags! { const TRUNC = 0o00001000; const CLOEXEC = 0o02000000; } + + struct GrndFlags: u32 { + const GRND_NONBLOCK = 1 << 0; + const GRND_RANDOM = 1 << 1; + } } |