@@ -4,13 +4,11 @@ use super::super::c;
4
4
#[ cfg( any( target_os = "android" , target_os = "linux" ) ) ]
5
5
use super :: super :: conv:: syscall_ret_owned_fd;
6
6
use super :: super :: conv:: { borrowed_fd, no_fd, ret} ;
7
- #[ cfg( not( target_os = "wasi" ) ) ]
8
7
use super :: super :: offset:: libc_mmap;
9
- #[ cfg( not( any ( target_os = "redox" , target_os = "wasi" ) ) ) ]
8
+ #[ cfg( not( target_os = "redox" ) ) ]
10
9
use super :: types:: Advice ;
11
10
#[ cfg( target_os = "linux" ) ]
12
11
use super :: types:: MremapFlags ;
13
- #[ cfg( not( target_os = "wasi" ) ) ]
14
12
use super :: types:: { MapFlags , MprotectFlags , MsyncFlags , ProtFlags } ;
15
13
#[ cfg( any( target_os = "android" , target_os = "linux" ) ) ]
16
14
use super :: types:: { MlockFlags , UserfaultfdFlags } ;
@@ -19,7 +17,7 @@ use crate::io;
19
17
#[ cfg( any( target_os = "android" , target_os = "linux" ) ) ]
20
18
use crate :: io:: OwnedFd ;
21
19
22
- #[ cfg( not( any ( target_os = "redox" , target_os = "wasi" ) ) ) ]
20
+ #[ cfg( not( target_os = "redox" ) ) ]
23
21
pub ( crate ) fn madvise ( addr : * mut c:: c_void , len : usize , advice : Advice ) -> io:: Result < ( ) > {
24
22
// On Linux platforms, `MADV_DONTNEED` has the same value as
25
23
// `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
53
51
}
54
52
}
55
53
56
- #[ cfg( not( target_os = "wasi" ) ) ]
57
54
pub ( crate ) unsafe fn msync ( addr : * mut c:: c_void , len : usize , flags : MsyncFlags ) -> io:: Result < ( ) > {
58
55
let err = c:: msync ( addr, len, flags. bits ( ) ) ;
59
56
@@ -69,7 +66,6 @@ pub(crate) unsafe fn msync(addr: *mut c::c_void, len: usize, flags: MsyncFlags)
69
66
///
70
67
/// `mmap` is primarily unsafe due to the `addr` parameter, as anything working
71
68
/// with memory pointed to by raw pointers is unsafe.
72
- #[ cfg( not( target_os = "wasi" ) ) ]
73
69
pub ( crate ) unsafe fn mmap (
74
70
ptr : * mut c:: c_void ,
75
71
len : usize ,
@@ -97,7 +93,6 @@ pub(crate) unsafe fn mmap(
97
93
///
98
94
/// `mmap` is primarily unsafe due to the `addr` parameter, as anything working
99
95
/// with memory pointed to by raw pointers is unsafe.
100
- #[ cfg( not( target_os = "wasi" ) ) ]
101
96
pub ( crate ) unsafe fn mmap_anonymous (
102
97
ptr : * mut c:: c_void ,
103
98
len : usize ,
@@ -119,7 +114,6 @@ pub(crate) unsafe fn mmap_anonymous(
119
114
}
120
115
}
121
116
122
- #[ cfg( not( target_os = "wasi" ) ) ]
123
117
pub ( crate ) unsafe fn mprotect (
124
118
ptr : * mut c:: c_void ,
125
119
len : usize ,
@@ -128,7 +122,6 @@ pub(crate) unsafe fn mprotect(
128
122
ret ( c:: mprotect ( ptr, len, flags. bits ( ) ) )
129
123
}
130
124
131
- #[ cfg( not( target_os = "wasi" ) ) ]
132
125
pub ( crate ) unsafe fn munmap ( ptr : * mut c:: c_void , len : usize ) -> io:: Result < ( ) > {
133
126
ret ( c:: munmap ( ptr, len) )
134
127
}
@@ -183,7 +176,6 @@ pub(crate) unsafe fn mremap_fixed(
183
176
///
184
177
/// `mlock` operates on raw pointers and may round out to the nearest page
185
178
/// boundaries.
186
- #[ cfg( not( target_os = "wasi" ) ) ]
187
179
#[ inline]
188
180
pub ( crate ) unsafe fn mlock ( addr : * mut c:: c_void , length : usize ) -> io:: Result < ( ) > {
189
181
ret ( c:: mlock ( addr, length) )
@@ -215,7 +207,6 @@ pub(crate) unsafe fn mlock_with(
215
207
///
216
208
/// `munlock` operates on raw pointers and may round out to the nearest page
217
209
/// boundaries.
218
- #[ cfg( not( target_os = "wasi" ) ) ]
219
210
#[ inline]
220
211
pub ( crate ) unsafe fn munlock ( addr : * mut c:: c_void , length : usize ) -> io:: Result < ( ) > {
221
212
ret ( c:: munlock ( addr, length) )
0 commit comments