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

sys::mman: adding MREMAP_DONTUNMAP flag for mremap on Linux. #2555

Merged
merged 1 commit into from
Dec 5, 2024

Conversation

devnexen
Copy link
Contributor

@devnexen devnexen commented Dec 4, 2024

Is meant to be used with MREMAP_MAYMOVE and allow to not unmapping old_address.

What does this PR do

Checklist:

  • I have read CONTRIBUTING.md
  • I have written necessary tests and rustdoc comments
  • A change log has been added if this PR modifies nix's API

@devnexen devnexen marked this pull request as ready for review December 4, 2024 23:27
Copy link
Member

@SteveLauC SteveLauC left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One nit:)

src/sys/mman.rs Outdated
@@ -205,6 +205,11 @@ libc_bitflags! {
/// Place the mapping at exactly the address specified in `new_address`.
#[cfg(target_os = "linux")]
MREMAP_FIXED;
/// Works in conjunction with `MREMAP_MAYMOVE` but does not unmap `old_address`.
/// Note that, in this case, `old_size` and `new_size` must be the same.
/// [`mremap(2)`]: https://man7.org/linux/man-pages/man2/mremap.2.html
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No need to link the man page here, it was already there

Suggested change
/// [`mremap(2)`]: https://man7.org/linux/man-pages/man2/mremap.2.html

Is meant to be used with `MREMAP_MAYMOVE` and allow to not unmapping
`old_address`.
Copy link
Member

@SteveLauC SteveLauC left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks

@SteveLauC SteveLauC added this pull request to the merge queue Dec 5, 2024
Merged via the queue into nix-rust:master with commit e7e9809 Dec 5, 2024
40 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants