vmm: add a safety comment for EpollContext
Signed-off-by: Wei Liu <liuwe@microsoft.com>
This commit is contained in:
parent
32af6f9723
commit
ff0e92ab88
1 changed files with 1 additions and 0 deletions
|
|
@ -178,6 +178,7 @@ impl EpollContext {
|
|||
pub fn new() -> result::Result<EpollContext, io::Error> {
|
||||
let epoll_fd = epoll::create(true)?;
|
||||
// Use 'File' to enforce closing on 'epoll_fd'
|
||||
// SAFETY: the epoll_fd returned by epoll::create is valid and owned by us.
|
||||
let epoll_file = unsafe { File::from_raw_fd(epoll_fd) };
|
||||
|
||||
Ok(EpollContext { epoll_file })
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue