Skip to content

Commit e469fc2

Browse files
committed
Auto merge of #2628 - devnexen:netbsd_prot_mprotect, r=Amanieu
netbsd add PROT_MPROTECT macros.
2 parents 805321e + 5d9ec7b commit e469fc2

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

libc-test/semver/netbsd.txt

+1
Original file line numberDiff line numberDiff line change
@@ -765,6 +765,7 @@ POSIX_SPAWN_SETSCHEDPARAM
765765
POSIX_SPAWN_SETSCHEDULER
766766
POSIX_SPAWN_SETSIGDEP
767767
POSIX_SPAWN_SETSIGMASK
768+
PROT_MPROTECT
768769
PTHREAD_CREATE_DETACHED
769770
PTHREAD_CREATE_JOINABLE
770771
PTHREAD_MUTEX_DEFAULT

src/unix/bsd/netbsdlike/netbsd/mod.rs

+8
Original file line numberDiff line numberDiff line change
@@ -2105,6 +2105,14 @@ f! {
21052105
};
21062106
::mem::size_of::<sockcred>() + ::mem::size_of::<::gid_t>() * ngrps
21072107
}
2108+
2109+
pub fn PROT_MPROTECT(x: ::c_int) -> ::c_int {
2110+
x << 3
2111+
}
2112+
2113+
pub fn PROT_MPROTECT_EXTRACT(x: ::c_int) -> ::c_int {
2114+
(x >> 3) & 0x7
2115+
}
21082116
}
21092117

21102118
safe_f! {

0 commit comments

Comments
 (0)