summaryrefslogtreecommitdiff
path: root/test/sys/test_mman.rs
diff options
context:
space:
mode:
Diffstat (limited to 'test/sys/test_mman.rs')
-rw-r--r--test/sys/test_mman.rs14
1 files changed, 7 insertions, 7 deletions
diff --git a/test/sys/test_mman.rs b/test/sys/test_mman.rs
index e748427b..b4674e53 100644
--- a/test/sys/test_mman.rs
+++ b/test/sys/test_mman.rs
@@ -1,15 +1,15 @@
use nix::sys::mman::{mmap, MapFlags, ProtFlags};
-use std::num::NonZeroUsize;
+use std::{num::NonZeroUsize, os::unix::io::BorrowedFd};
#[test]
fn test_mmap_anonymous() {
unsafe {
- let ptr = mmap(
+ let ptr = mmap::<BorrowedFd>(
None,
NonZeroUsize::new(1).unwrap(),
ProtFlags::PROT_READ | ProtFlags::PROT_WRITE,
MapFlags::MAP_PRIVATE | MapFlags::MAP_ANONYMOUS,
- -1,
+ None,
0,
)
.unwrap() as *mut u8;
@@ -29,12 +29,12 @@ fn test_mremap_grow() {
let one_k_non_zero = NonZeroUsize::new(ONE_K).unwrap();
let slice: &mut [u8] = unsafe {
- let mem = mmap(
+ let mem = mmap::<BorrowedFd>(
None,
one_k_non_zero,
ProtFlags::PROT_READ | ProtFlags::PROT_WRITE,
MapFlags::MAP_ANONYMOUS | MapFlags::MAP_PRIVATE,
- -1,
+ None,
0,
)
.unwrap();
@@ -87,12 +87,12 @@ fn test_mremap_shrink() {
const ONE_K: size_t = 1024;
let ten_one_k = NonZeroUsize::new(10 * ONE_K).unwrap();
let slice: &mut [u8] = unsafe {
- let mem = mmap(
+ let mem = mmap::<BorrowedFd>(
None,
ten_one_k,
ProtFlags::PROT_READ | ProtFlags::PROT_WRITE,
MapFlags::MAP_ANONYMOUS | MapFlags::MAP_PRIVATE,
- -1,
+ None,
0,
)
.unwrap();