mirror of
https://github.com/rust-lang/rust.git
synced 2026-05-21 17:52:12 +03:00
kmc-solid: Implement FileDesc::duplicate
This commit is contained in:
@@ -175,6 +175,9 @@ pub struct fd_set {
|
||||
#[link_name = "SOLID_NET_Close"]
|
||||
pub fn close(s: c_int) -> c_int;
|
||||
|
||||
#[link_name = "SOLID_NET_Dup"]
|
||||
pub fn dup(s: c_int) -> c_int;
|
||||
|
||||
#[link_name = "SOLID_NET_GetPeerName"]
|
||||
pub fn getpeername(s: c_int, name: *mut sockaddr, namelen: *mut socklen_t) -> c_int;
|
||||
|
||||
|
||||
@@ -107,7 +107,7 @@ fn is_write_vectored(&self) -> bool {
|
||||
}
|
||||
|
||||
fn duplicate(&self) -> io::Result<FileDesc> {
|
||||
super::unsupported()
|
||||
cvt(unsafe { netc::dup(self.fd) }).map(Self::new)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user