mirror of
https://github.com/asterinas/asterinas.git
synced 2025-06-23 09:23:25 +00:00
Add normalize for timeval_t
and const value for time
This commit is contained in:
committed by
Tate, Hongliang Tian
parent
4fa4e5ef2a
commit
b4003b8aeb
@ -19,9 +19,10 @@ pub fn sys_select(
|
||||
let timeout = if timeval_addr == 0 {
|
||||
None
|
||||
} else {
|
||||
let mut timeval = ctx.get_user_space().read_val::<timeval_t>(timeval_addr)?;
|
||||
timeval.sec += timeval.usec / 1_000_000;
|
||||
timeval.usec %= 1_000_000;
|
||||
let timeval = ctx
|
||||
.get_user_space()
|
||||
.read_val::<timeval_t>(timeval_addr)?
|
||||
.normalize();
|
||||
Some(Duration::try_from(timeval)?)
|
||||
};
|
||||
|
||||
|
Reference in New Issue
Block a user