Skip to content

Commit

Permalink
Auto merge of #2628 - devnexen:netbsd_prot_mprotect, r=Amanieu
Browse files Browse the repository at this point in the history
netbsd add PROT_MPROTECT macros.
  • Loading branch information
bors committed Jan 16, 2022
2 parents 805321e + 5d9ec7b commit e469fc2
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
1 change: 1 addition & 0 deletions libc-test/semver/netbsd.txt
Original file line number Diff line number Diff line change
Expand Up @@ -765,6 +765,7 @@ POSIX_SPAWN_SETSCHEDPARAM
POSIX_SPAWN_SETSCHEDULER
POSIX_SPAWN_SETSIGDEP
POSIX_SPAWN_SETSIGMASK
PROT_MPROTECT
PTHREAD_CREATE_DETACHED
PTHREAD_CREATE_JOINABLE
PTHREAD_MUTEX_DEFAULT
Expand Down
8 changes: 8 additions & 0 deletions src/unix/bsd/netbsdlike/netbsd/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2105,6 +2105,14 @@ f! {
};
::mem::size_of::<sockcred>() + ::mem::size_of::<::gid_t>() * ngrps
}

pub fn PROT_MPROTECT(x: ::c_int) -> ::c_int {
x << 3
}

pub fn PROT_MPROTECT_EXTRACT(x: ::c_int) -> ::c_int {
(x >> 3) & 0x7
}
}

safe_f! {
Expand Down

0 comments on commit e469fc2

Please sign in to comment.