Skip to content

Commit 45a9cf4

Browse files
committed
Adds OwnedFd::as_raw_fd
1 parent 32bf2a2 commit 45a9cf4

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/fd/mod.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,12 @@ pub struct OwnedFd<K: Kernel> {
8585
phantom: PhantomData<*const ()>, // For !Send.
8686
}
8787

88+
impl<K: Kernel> OwnedFd<K> {
89+
pub fn as_raw_fd(&self) -> c_int {
90+
self.fd
91+
}
92+
}
93+
8894
impl<K: Kernel> Drop for OwnedFd<K> {
8995
fn drop(&mut self) {
9096
// This drop must be called from the same process as the one that created the FD.

0 commit comments

Comments
 (0)