mirror of
https://github.com/asterinas/asterinas.git
synced 2025-06-23 01:13:23 +00:00
Select should not return ETIME
This commit is contained in:
committed by
Tate, Hongliang Tian
parent
2766d95c18
commit
49eef0c094
@ -52,13 +52,26 @@ pub fn sys_select(
|
||||
nfds, readfds, writefds, exceptfds, timeout
|
||||
);
|
||||
|
||||
let num_revents = do_select(
|
||||
let num_revents = match do_select(
|
||||
nfds,
|
||||
readfds.as_mut(),
|
||||
writefds.as_mut(),
|
||||
exceptfds.as_mut(),
|
||||
timeout,
|
||||
)?;
|
||||
) {
|
||||
Ok(num_revents) => num_revents,
|
||||
Err(e) if e.error() == Errno::ETIME => {
|
||||
// The return value is zero if the timeout expires
|
||||
// before any file descriptors became ready
|
||||
return Ok(SyscallReturn::Return(0));
|
||||
}
|
||||
Err(e) => return Err(e),
|
||||
};
|
||||
|
||||
// FIXME: The Linux select() and pselect6() system call
|
||||
// modifies its timeout argument to reflect the amount of time not slept.
|
||||
// However, the glibc wrapper function hides this behavior.
|
||||
// Maybe we should follow the Linux behavior.
|
||||
|
||||
let set_fdset = |fdset_addr: Vaddr, fdset: Option<FdSet>| -> Result<()> {
|
||||
if let Some(fdset) = fdset {
|
||||
|
Reference in New Issue
Block a user