We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
FileDesc::duplicate
1 parent 5ab502c commit da0d506Copy full SHA for da0d506
library/std/src/sys/solid/abi/sockets.rs
@@ -175,6 +175,9 @@ extern "C" {
175
#[link_name = "SOLID_NET_Close"]
176
pub fn close(s: c_int) -> c_int;
177
178
+ #[link_name = "SOLID_NET_Dup"]
179
+ pub fn dup(s: c_int) -> c_int;
180
+
181
#[link_name = "SOLID_NET_GetPeerName"]
182
pub fn getpeername(s: c_int, name: *mut sockaddr, namelen: *mut socklen_t) -> c_int;
183
library/std/src/sys/solid/net.rs
@@ -107,7 +107,7 @@ impl FileDesc {
107
}
108
109
fn duplicate(&self) -> io::Result<FileDesc> {
110
- super::unsupported()
+ cvt(unsafe { netc::dup(self.fd) }).map(Self::new)
111
112
113
0 commit comments