MCPcopy Create free account
hub / github.com/cloud-hypervisor/cloud-hypervisor / new

Method new

vmm/src/lib.rs:290–297  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

288
289impl EpollContext {
290 pub fn new() -> result::Result<EpollContext, io::Error> {
291 let epoll_fd = epoll::create(true)?;
292 // Use 'File' to enforce closing on 'epoll_fd'
293 // SAFETY: the epoll_fd returned by epoll::create is valid and owned by us.
294 let epoll_file = unsafe { File::from_raw_fd(epoll_fd) };
295
296 Ok(EpollContext { epoll_file })
297 }
298
299 pub fn add_event<T>(&mut self, fd: &T, token: EpollDispatch) -> result::Result<(), io::Error>
300 where

Callers

nothing calls this directly

Calls 3

createFunction · 0.85
newFunction · 0.85
add_eventMethod · 0.45

Tested by

no test coverage detected