mirror of
https://chromium.googlesource.com/crosvm/crosvm
synced 2025-01-27 02:28:22 +00:00
sys_util: impl Pollable for File
Files are Pollable because they have an FD. Whether this makes sense for any specific `File` is not enforced, but it will never be unsafe or undefined when used with Poller. BUG=chromium:793688 TEST=None Change-Id: I2ce7ffd1b408bcee5ffbb3738d26339aa0c466e0 Reviewed-on: https://chromium-review.googlesource.com/985617 Commit-Ready: Zach Reizner <zachr@chromium.org> Tested-by: Zach Reizner <zachr@chromium.org> Reviewed-by: Stephen Barber <smbarber@chromium.org>
This commit is contained in:
parent
1028f53ed2
commit
b2e528b575
1 changed files with 6 additions and 0 deletions
|
@ -55,6 +55,12 @@ unsafe impl Pollable for UnixDatagram {
|
|||
}
|
||||
}
|
||||
|
||||
unsafe impl Pollable for File {
|
||||
fn pollable_fd(&self) -> RawFd {
|
||||
self.as_raw_fd()
|
||||
}
|
||||
}
|
||||
|
||||
/// Used to poll multiple `Pollable` objects at once.
|
||||
///
|
||||
/// # Example
|
||||
|
|
Loading…
Reference in a new issue