diff options
author | edef <edef@unfathomable.blue> | 2022-07-28 01:09:31 +0000 |
---|---|---|
committer | edef <edef@unfathomable.blue> | 2022-07-28 01:09:31 +0000 |
commit | 2a091d6689ed8f85b14d858abe2f31abe9f6a218 (patch) | |
tree | 61fa8445975c958b2a8e6214243a7a883abfe4fe /ripple | |
parent | 58a2874ba52fa44bf8350c4fab259d237fe2d8b8 (diff) | |
download | unf-legacy-2a091d6689ed8f85b14d858abe2f31abe9f6a218.tar.zst |
ripple/minitrace: bitflags-ify mmap/mprotect protection flags
Change-Id: Iaf6d5717e2d83a6f81fda34da086311d21f345c2
Diffstat (limited to 'ripple')
-rw-r--r-- | ripple/minitrace/src/main.rs | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/ripple/minitrace/src/main.rs b/ripple/minitrace/src/main.rs index 6db4747..aa761de 100644 --- a/ripple/minitrace/src/main.rs +++ b/ripple/minitrace/src/main.rs @@ -235,8 +235,8 @@ define_syscalls! { fn read(fd: FileDesc, buf: *mut u8, count: usize) -> i64 = 0; fn write(fd: FileDesc, buf: *const u8, count: usize) -> i64 = 1; fn close(fd: FileDesc) -> i64 = 3; - fn mmap(addr: u64, len: u64, prot: u64, flags: MapFlags, fd: FileDesc, off: u64) -> i64 = 9; - fn mprotect(addr: u64, len: usize, prot: u64) -> i64 = 10; + fn mmap(addr: u64, len: u64, prot: ProtFlags, flags: MapFlags, fd: 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: i32, act: *const SigAction, oact: *mut SigAction, sigsetsize: usize) -> i64 = 13; fn ioctl(fd: FileDesc, cmd: u32, arg: u64) -> i64 = 16; @@ -479,4 +479,10 @@ syscall_bitflags! { const ANONYMOUS = 1 << 5; const DENYWRITE = 1 << 11; } + + struct ProtFlags: i32 { + const READ = 1 << 0; + const WRITE = 1 << 1; + const EXEC = 1 << 2; + } } |