We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b003c2f commit 0d9fedcCopy full SHA for 0d9fedc
src/sys/eventfd.rs
@@ -58,6 +58,13 @@ impl EventFd {
58
Self::from_value_and_flags(init_val, EfdFlags::empty())
59
}
60
61
+ /// Constructs an `EventFd` wrapping an existing `OwnedFd`.
62
+ ///
63
+ /// Safety: `OwnedFd` is a valid eventfd.
64
+ pub unsafe fn from_owned_fd(fd: OwnedFd) -> Self {
65
+ Self(fd)
66
+ }
67
+
68
/// Enqueues `value` triggers, i.e., adds the integer value supplied in `value`
69
/// to the counter.
70
///
@@ -106,4 +113,4 @@ impl From<EventFd> for OwnedFd {
106
113
fn from(value: EventFd) -> Self {
107
114
value.0
108
115
109
-}
116
+}
0 commit comments