File tree Expand file tree Collapse file tree
maybe_polyfill/no_std/os/fd Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -112,12 +112,11 @@ impl OwnedFd {
112112 Ok ( fd. into ( ) )
113113 }
114114
115+ /// Creates a new `OwnedFd` instance that shares the same underlying file handle
116+ /// as the existing `OwnedFd` instance.
115117 #[ cfg( target_arch = "wasm32" ) ]
116118 pub fn try_clone ( & self ) -> crate :: io:: Result < Self > {
117- Err ( crate :: io:: const_io_error!(
118- crate :: io:: ErrorKind :: Unsupported ,
119- "operation not supported on WASI yet" ,
120- ) )
119+ Err ( crate :: io:: Errno :: NOSYS )
121120 }
122121}
123122
@@ -150,10 +149,7 @@ impl BorrowedFd<'_> {
150149 #[ cfg( any( target_arch = "wasm32" , target_os = "hermit" ) ) ]
151150 #[ cfg_attr( staged_api, stable( feature = "io_safety" , since = "1.63.0" ) ) ]
152151 pub fn try_clone_to_owned ( & self ) -> crate :: io:: Result < OwnedFd > {
153- Err ( crate :: io:: const_io_error!(
154- crate :: io:: ErrorKind :: Unsupported ,
155- "operation not supported on WASI yet" ,
156- ) )
152+ Err ( crate :: io:: Errno :: NOSYS )
157153 }
158154}
159155
Original file line number Diff line number Diff line change 66//! between different processes on the same system.
77
88mod auxv;
9- #[ cfg( feature = "use-explicitly-provided-auxv" ) ]
9+ #[ cfg( all ( feature = "use-explicitly-provided-auxv" , not ( libc ) ) ) ]
1010mod init;
1111
1212pub use auxv:: * ;
13- #[ cfg( feature = "use-explicitly-provided-auxv" ) ]
13+ #[ cfg( all ( feature = "use-explicitly-provided-auxv" , not ( libc ) ) ) ]
1414pub use init:: init;
Original file line number Diff line number Diff line change @@ -1063,10 +1063,12 @@ where
10631063
10641064 #[ cfg( not( feature = "alloc" ) ) ]
10651065 {
1066- #[ cfg( libc) ]
1066+ #[ cfg( all ( libc, not ( target_os = "wasi" ) ) ) ]
10671067 const LARGE_PATH_BUFFER_SIZE : usize = libc:: PATH_MAX as usize ;
10681068 #[ cfg( linux_raw) ]
10691069 const LARGE_PATH_BUFFER_SIZE : usize = linux_raw_sys:: general:: PATH_MAX as usize ;
1070+ #[ cfg( target_os = "wasi" ) ]
1071+ const LARGE_PATH_BUFFER_SIZE : usize = 4096 as usize ; // TODO: upstream this
10701072
10711073 // Taken from
10721074 // <https://github.com/rust-lang/rust/blob/a00f8ba7fcac1b27341679c51bf5a3271fa82df3/library/std/src/sys/common/small_c_string.rs>
You can’t perform that action at this time.
0 commit comments