mirror of
https://github.com/asterinas/asterinas.git
synced 2025-06-27 19:33:23 +00:00
Poll should not return ETIME
This commit is contained in:
committed by
Tate, Hongliang Tian
parent
bffc34c94b
commit
2766d95c18
@ -36,7 +36,16 @@ pub fn sys_poll(fds: Vaddr, nfds: u64, timeout: i32) -> Result<SyscallReturn> {
|
||||
poll_fds, nfds, timeout
|
||||
);
|
||||
|
||||
let num_revents = do_poll(&poll_fds, timeout)?;
|
||||
let num_revents = match do_poll(&poll_fds, timeout) {
|
||||
Ok(num_events) => num_events,
|
||||
Err(e) if e.error() == Errno::ETIME => {
|
||||
// If the system call timed out
|
||||
// before any file descriptors became ready,
|
||||
// return 0.
|
||||
return Ok(SyscallReturn::Return(0));
|
||||
}
|
||||
Err(e) => return Err(e),
|
||||
};
|
||||
|
||||
// Write back
|
||||
let mut write_addr = fds;
|
||||
|
Reference in New Issue
Block a user