-
Notifications
You must be signed in to change notification settings - Fork 689
mman module netbsd additions. #1520
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you please add a test? Probably you can just enable the existing test_mremap_grow
and test_mremap_shrink
for NetBSD?
src/sys/mman.rs
Outdated
@@ -351,6 +363,29 @@ pub unsafe fn mremap( | |||
} | |||
} | |||
|
|||
#[cfg(target_os = "netbsd")] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This function already exists on Linux, and it looks to me like the only different is the operand order. In the interest of portability, could you please share a single signature for the two operating systems? You can use cfg_if!
around the libc syscall to handle the different operand orders.
src/sys/mman.rs
Outdated
@@ -150,6 +152,16 @@ libc_bitflags!{ | |||
} | |||
} | |||
|
|||
#[cfg(target_os = "netbsd")] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You should share this definition with the Linux one.
src/sys/mman.rs
Outdated
@@ -136,6 +136,8 @@ libc_bitflags!{ | |||
MAP_NOCACHE; | |||
#[cfg(any(target_os = "ios", target_os = "macos"))] | |||
MAP_JIT; | |||
#[cfg(target_os = "freebsd")] | |||
MAP_ALIGNED_SUPER; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems unrelated to the mremap stuff. Better to put it in its own PR.
b9c4167
to
a477541
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, assuming you ran the tests on NetBSD. CI doesn't.
bors r+
@asomers while testing #1624 I found that I'll submit a PR (another day) to clean all this up. The NetBSD man page for
Whereas nix's documentation for the corresponding parameter
I believe nix's documentation is completely backwards. If The test passes On a related note, I have a NetBSD VM now. |
@devnexen no change, test still fails. |
in my netbsd laptop 3 times out of 4 it passes however if indeed I put a address in the last argument it always pass. |
No description provided.