summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>2022-01-19 13:55:51 +0000
committerGitHub <noreply@github.com>2022-01-19 13:55:51 +0000
commitc84316b7fce588eb9e91b917550a0dfd350dcad1 (patch)
tree4be5892d6969cec4c4137e47f2e2c27326bf4a3d
parentc3731f1e7cc5fbfb3ee8309ecaffd67210e5e690 (diff)
parent5f0072130e3d5e942601cc06da9934f2e3ab5c07 (diff)
downloadnix-c84316b7fce588eb9e91b917550a0dfd350dcad1.zip
Merge #1636
1636: Add MAP_FIXED_NOREPLACE on Linux r=rtzoeller a=rtzoeller Resolves #1393. Co-authored-by: Ryan Zoeller <rtzoeller@rtzoeller.com>
-rw-r--r--CHANGELOG.md2
-rw-r--r--src/sys/mman.rs4
2 files changed, 6 insertions, 0 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 5d84e7eb..418ea62e 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -35,6 +35,8 @@ This project adheres to [Semantic Versioning](https://semver.org/).
(#[1634](https://github.com/nix-rust/nix/pull/1634))
- Added `getresuid`, `setresuid`, `getresgid`, and `setresgid` on DragonFly, FreeBSD, and OpenBSD.
(#[1628](https://github.com/nix-rust/nix/pull/1628))
+- Added `MAP_FIXED_NOREPLACE` on Linux.
+ (#[1636](https://github.com/nix-rust/nix/pull/1636))
### Changed
### Fixed
diff --git a/src/sys/mman.rs b/src/sys/mman.rs
index 7302a65a..523b4683 100644
--- a/src/sys/mman.rs
+++ b/src/sys/mman.rs
@@ -43,6 +43,10 @@ libc_bitflags!{
MAP_PRIVATE;
/// Place the mapping at exactly the address specified in `addr`.
MAP_FIXED;
+ /// Place the mapping at exactly the address specified in `addr`, but never clobber an existing range.
+ #[cfg(target_os = "linux")]
+ #[cfg_attr(docsrs, doc(cfg(all())))]
+ MAP_FIXED_NOREPLACE;
/// To be used with `MAP_FIXED`, to forbid the system
/// to select a different address than the one specified.
#[cfg(target_os = "freebsd")]