Add support for monitoring epoll fds with epoll
This commit is contained in:
parent
25350b0e85
commit
1c707eda30
@ -97,6 +97,12 @@ impl EpollFile {
|
||||
socket.fd()
|
||||
} else if let Ok(eventfd) = fd_ref.as_event() {
|
||||
eventfd.get_host_fd()
|
||||
} else if let Ok(epoll_file) = fd_ref.as_epfile() {
|
||||
let target_host_fd = epoll_file.get_host_fd();
|
||||
if self.host_fd == target_host_fd {
|
||||
return_errno!(EINVAL, "epfd should not be same as the target fd");
|
||||
}
|
||||
target_host_fd
|
||||
} else {
|
||||
return_errno!(EPERM, "unsupported file type");
|
||||
}
|
||||
@ -145,6 +151,10 @@ impl EpollFile {
|
||||
|
||||
Ok(ret)
|
||||
}
|
||||
|
||||
fn get_host_fd(&self) -> c_int {
|
||||
self.host_fd
|
||||
}
|
||||
}
|
||||
|
||||
impl Drop for EpollFile {
|
||||
|
Loading…
Reference in New Issue
Block a user