Skip to content

Commit bde53ca

Browse files
committed
Rename RemapFlags to MRemapFlags for consistency with MREMAP macro prefix
1 parent 6821da0 commit bde53ca

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

src/sys/mman.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ libc_bitflags!{
142142
#[cfg(target_os = "linux")]
143143
libc_bitflags!{
144144
/// Options for `mremap()`.
145-
pub struct RemapFlags: c_int {
145+
pub struct MRemapFlags: c_int {
146146
/// Permit the kernel to relocate the mapping to a new virtual address, if necessary.
147147
MREMAP_MAYMOVE;
148148
/// Place the mapping at exactly the address specified in `new_address`.
@@ -336,7 +336,7 @@ pub unsafe fn mremap(
336336
addr: *mut c_void,
337337
old_size: size_t,
338338
new_size: size_t,
339-
flags: RemapFlags,
339+
flags: MRemapFlags,
340340
new_address: Option<* mut c_void>,
341341
) -> Result<*mut c_void> {
342342
let ret = libc::mremap(addr, old_size, new_size, flags.bits(), new_address.unwrap_or(std::ptr::null_mut()));

test/sys/test_mman.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ use nix::libc::{c_void, size_t};
33
use nix::sys::mman::{mmap, MapFlags, ProtFlags};
44

55
#[cfg(target_os = "linux")]
6-
use nix::sys::mman::{mremap, RemapFlags};
6+
use nix::sys::mman::{mremap, MRemapFlags};
77

88
#[test]
99
fn test_mmap_anonymous() {
@@ -36,7 +36,7 @@ fn test_mremap_grow() {
3636

3737
let slice : &mut[u8] = unsafe {
3838
let mem = mremap(slice.as_mut_ptr() as * mut c_void, ONE_K, 10 * ONE_K,
39-
RemapFlags::MREMAP_MAYMOVE, None)
39+
MRemapFlags::MREMAP_MAYMOVE, None)
4040
.unwrap();
4141
std::slice::from_raw_parts_mut(mem as * mut u8, 10 * ONE_K)
4242
};
@@ -67,7 +67,7 @@ fn test_mremap_shrink() {
6767

6868
let slice : &mut[u8] = unsafe {
6969
let mem = mremap(slice.as_mut_ptr() as * mut c_void, 10 * ONE_K, ONE_K,
70-
RemapFlags::empty(), None)
70+
MRemapFlags::empty(), None)
7171
.unwrap();
7272
// Since we didn't supply MREMAP_MAYMOVE, the address should be the
7373
// same.

0 commit comments

Comments
 (0)