Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

freebsd adding PROT_MAX|PROT_MAX_EXTRACT mmap flags #3399

Merged
merged 1 commit into from
Oct 28, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions libc-test/semver/freebsd.txt
Original file line number Diff line number Diff line change
Expand Up @@ -972,6 +972,8 @@ PROC_WX_MAPPINGS_PERMIT
PROC_WXMAP_CTL
PROC_WXMAP_STATUS
PROC_WXORX_ENFORCE
PROT_MAX
PROT_MAX_EXTRACT
PTHREAD_CREATE_DETACHED
PTHREAD_CREATE_JOINABLE
PTHREAD_MUTEX_ADAPTIVE_NP
Expand Down
8 changes: 8 additions & 0 deletions src/unix/bsd/freebsdlike/freebsd/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4829,6 +4829,14 @@ f! {
};
::mem::size_of::<sockcred2>() + ::mem::size_of::<::gid_t>() * ngrps
}

pub fn PROT_MAX(x: ::c_int) -> ::c_int {
x << 16
}

pub fn PROT_MAX_EXTRACT(x: ::c_int) -> ::c_int {
(x >> 16) & (::PROT_READ | ::PROT_WRITE | ::PROT_EXEC)
}
}

safe_f! {
Expand Down