Skip to content

Commit

Permalink
kmc-solid: Implement FileDesc::duplicate
Browse files Browse the repository at this point in the history
  • Loading branch information
kawadakk committed Jan 28, 2022
1 parent 5ab502c commit da0d506
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions library/std/src/sys/solid/abi/sockets.rs
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,9 @@ extern "C" {
#[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;

Expand Down
2 changes: 1 addition & 1 deletion library/std/src/sys/solid/net.rs
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ impl FileDesc {
}

fn duplicate(&self) -> io::Result<FileDesc> {
super::unsupported()
cvt(unsafe { netc::dup(self.fd) }).map(Self::new)
}
}

Expand Down

0 comments on commit da0d506

Please sign in to comment.