Skip to content

Commit e4e17f2

Browse files
bors[bot]rtzoeller
andauthored
Merge #1625
1625: Correct MAP_FIXED documentation for NetBSD r=rtzoeller a=rtzoeller The previous documentation described the default behavior, rather than the behavior when the flag was set. Also fix a test which is failing due to passing this flag erroneously. Co-authored-by: Ryan Zoeller <rtzoeller@rtzoeller.com>
2 parents c1abab9 + b7dd35e commit e4e17f2

File tree

2 files changed

+1
-6
lines changed

2 files changed

+1
-6
lines changed

src/sys/mman.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ libc_bitflags!{
195195
#[cfg(target_os = "linux")]
196196
#[cfg_attr(docsrs, doc(cfg(all())))]
197197
MREMAP_FIXED;
198-
/// Permits to use the old and new address as hints to relocate the mapping.
198+
/// Place the mapping at exactly the address specified in `new_address`.
199199
#[cfg(target_os = "netbsd")]
200200
#[cfg_attr(docsrs, doc(cfg(all())))]
201201
MAP_FIXED;

test/sys/test_mman.rs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -73,16 +73,11 @@ fn test_mremap_shrink() {
7373
assert_eq !(slice[ONE_K - 1], 0xFF);
7474

7575
let slice : &mut[u8] = unsafe {
76-
#[cfg(target_os = "linux")]
7776
let mem = mremap(slice.as_mut_ptr() as * mut c_void, 10 * ONE_K, ONE_K,
7877
MRemapFlags::empty(), None)
7978
.unwrap();
8079
// Since we didn't supply MREMAP_MAYMOVE, the address should be the
8180
// same.
82-
#[cfg(target_os = "netbsd")]
83-
let mem = mremap(slice.as_mut_ptr() as * mut c_void, 10 * ONE_K, ONE_K,
84-
MRemapFlags::MAP_FIXED, None)
85-
.unwrap();
8681
assert_eq !(mem, slice.as_mut_ptr() as * mut c_void);
8782
std::slice::from_raw_parts_mut(mem as * mut u8, ONE_K)
8883
};

0 commit comments

Comments
 (0)