bsd: Add missing minherit system call#4849
Conversation
|
The |
tgross35
left a comment
There was a problem hiding this comment.
Would you be able to use mach2 instead? https://docs.rs/mach2/latest/mach2/vm_inherit/index.html. We're tryig to transition away from binding platform API like mach/ and linux/.
|
Reminder, once the PR becomes ready for a review, use |
|
@tgross35 FWIW |
|
Thanks for the links. In that case I think it’s fine here, but would you mind enabling it for those other platforms as well? At least FreeBSD and NetBSD get CI here. |
678ab86 to
8530b90
Compare
e599cd6 to
0b039e8
Compare
| VM_INHERIT_COPY | ||
| VM_INHERIT_DONATE_COPY | ||
| VM_INHERIT_NONE | ||
| VM_INHERIT_SHARE |
There was a problem hiding this comment.
The non-Apple BSDs seem to use MAP_ as the prefix rather than VM_. I think you'll need to add those constants and update these files.
6a6f024 to
e6d6630
Compare
|
@oherrala this seems reasonably fine to me, any reason it's marked as a draft still? |
|
@tgross35 this is needed for one of my free time projects that has been on hold and I've forgotten about this. Sorry about that. Now marked as ready for review. |
| #[cfg(target_os = "netbsd")] | ||
| pub const MAP_INHERIT_DONATE_COPY: c_int = 3; | ||
| #[cfg(target_os = "netbsd")] | ||
| pub const MAP_INHERIT_ZERO: c_int = 4; |
There was a problem hiding this comment.
MAP_INHERIT_ZERO exists in OpenBSD with value 3.
here you omit it, and still declaring it in the semver openbsd.txt file.
There was a problem hiding this comment.
@semarie Good catch! Fixed:
libc/src/unix/bsd/netbsdlike/mod.rs
Lines 220 to 221 in c538525
|
Could you rebase this as well? There have been some changes to freebsd CI. |
This comment has been minimized.
This comment has been minimized.
|
@tgross35 Rebased and also fixed the one issue semarie pointed out. |
|
@rustbot author, CI failures are because the semver files aren't accurate
+1 here, could you move these to the separate files? It's fine that |
This comment has been minimized.
This comment has been minimized.
|
This PR was rebased onto a different main commit. Here's a range-diff highlighting what actually changed. Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers. |
@tgross35 this is now done. |
Description
Add a missing
minherit()system call and constants related to it.minherit(2) from macOS describes this call as:
Sources
Checklist
libc-test/semverhave been updated*LASTor*MAXareincluded (see #3131)
cd libc-test && cargo test --target mytarget);especially relevant for platforms that may not be checked in CI
@rustbot label +stable-nominated