@@ -4,13 +4,11 @@ use super::super::c;
44#[ cfg( any( target_os = "android" , target_os = "linux" ) ) ]
55use super :: super :: conv:: syscall_ret_owned_fd;
66use super :: super :: conv:: { borrowed_fd, no_fd, ret} ;
7- #[ cfg( not( target_os = "wasi" ) ) ]
87use super :: super :: offset:: libc_mmap;
9- #[ cfg( not( any ( target_os = "redox" , target_os = "wasi" ) ) ) ]
8+ #[ cfg( not( target_os = "redox" ) ) ]
109use super :: types:: Advice ;
1110#[ cfg( target_os = "linux" ) ]
1211use super :: types:: MremapFlags ;
13- #[ cfg( not( target_os = "wasi" ) ) ]
1412use super :: types:: { MapFlags , MprotectFlags , MsyncFlags , ProtFlags } ;
1513#[ cfg( any( target_os = "android" , target_os = "linux" ) ) ]
1614use super :: types:: { MlockFlags , UserfaultfdFlags } ;
@@ -19,7 +17,7 @@ use crate::io;
1917#[ cfg( any( target_os = "android" , target_os = "linux" ) ) ]
2018use crate :: io:: OwnedFd ;
2119
22- #[ cfg( not( any ( target_os = "redox" , target_os = "wasi" ) ) ) ]
20+ #[ cfg( not( target_os = "redox" ) ) ]
2321pub ( crate ) fn madvise ( addr : * mut c:: c_void , len : usize , advice : Advice ) -> io:: Result < ( ) > {
2422 // On Linux platforms, `MADV_DONTNEED` has the same value as
2523 // `POSIX_MADV_DONTNEED` but different behavior. We remap it to a different
@@ -53,7 +51,6 @@ pub(crate) fn madvise(addr: *mut c::c_void, len: usize, advice: Advice) -> io::R
5351 }
5452}
5553
56- #[ cfg( not( target_os = "wasi" ) ) ]
5754pub ( crate ) unsafe fn msync ( addr : * mut c:: c_void , len : usize , flags : MsyncFlags ) -> io:: Result < ( ) > {
5855 let err = c:: msync ( addr, len, flags. bits ( ) ) ;
5956
@@ -69,7 +66,6 @@ pub(crate) unsafe fn msync(addr: *mut c::c_void, len: usize, flags: MsyncFlags)
6966///
7067/// `mmap` is primarily unsafe due to the `addr` parameter, as anything working
7168/// with memory pointed to by raw pointers is unsafe.
72- #[ cfg( not( target_os = "wasi" ) ) ]
7369pub ( crate ) unsafe fn mmap (
7470 ptr : * mut c:: c_void ,
7571 len : usize ,
@@ -97,7 +93,6 @@ pub(crate) unsafe fn mmap(
9793///
9894/// `mmap` is primarily unsafe due to the `addr` parameter, as anything working
9995/// with memory pointed to by raw pointers is unsafe.
100- #[ cfg( not( target_os = "wasi" ) ) ]
10196pub ( crate ) unsafe fn mmap_anonymous (
10297 ptr : * mut c:: c_void ,
10398 len : usize ,
@@ -119,7 +114,6 @@ pub(crate) unsafe fn mmap_anonymous(
119114 }
120115}
121116
122- #[ cfg( not( target_os = "wasi" ) ) ]
123117pub ( crate ) unsafe fn mprotect (
124118 ptr : * mut c:: c_void ,
125119 len : usize ,
@@ -128,7 +122,6 @@ pub(crate) unsafe fn mprotect(
128122 ret ( c:: mprotect ( ptr, len, flags. bits ( ) ) )
129123}
130124
131- #[ cfg( not( target_os = "wasi" ) ) ]
132125pub ( crate ) unsafe fn munmap ( ptr : * mut c:: c_void , len : usize ) -> io:: Result < ( ) > {
133126 ret ( c:: munmap ( ptr, len) )
134127}
@@ -183,7 +176,6 @@ pub(crate) unsafe fn mremap_fixed(
183176///
184177/// `mlock` operates on raw pointers and may round out to the nearest page
185178/// boundaries.
186- #[ cfg( not( target_os = "wasi" ) ) ]
187179#[ inline]
188180pub ( crate ) unsafe fn mlock ( addr : * mut c:: c_void , length : usize ) -> io:: Result < ( ) > {
189181 ret ( c:: mlock ( addr, length) )
@@ -215,7 +207,6 @@ pub(crate) unsafe fn mlock_with(
215207///
216208/// `munlock` operates on raw pointers and may round out to the nearest page
217209/// boundaries.
218- #[ cfg( not( target_os = "wasi" ) ) ]
219210#[ inline]
220211pub ( crate ) unsafe fn munlock ( addr : * mut c:: c_void , length : usize ) -> io:: Result < ( ) > {
221212 ret ( c:: munlock ( addr, length) )
0 commit comments