mirror of
https://github.com/asterinas/asterinas.git
synced 2025-06-20 13:06:33 +00:00
Implementation of load average calculation and corresponding /proc entry
Moved everything into the kernel side. Add a SchedulerStats trait Use 'fixed' to represent fixed-point numbers Make the loadavg calculation lazy
This commit is contained in:
committed by
Tate, Hongliang Tian
parent
efd49a96e3
commit
4701eaf0cb
@ -46,7 +46,7 @@ fn handle_getfd(fd: FileDesc, ctx: &Context) -> Result<SyscallReturn> {
|
||||
}
|
||||
|
||||
fn handle_setfd(fd: FileDesc, arg: u64, ctx: &Context) -> Result<SyscallReturn> {
|
||||
let flags = if arg > u8::MAX.into() {
|
||||
let flags = if arg > u64::from(u8::MAX) {
|
||||
return_errno_with_message!(Errno::EINVAL, "invalid fd flags");
|
||||
} else {
|
||||
FdFlags::from_bits(arg as u8).ok_or(Error::with_message(Errno::EINVAL, "invalid flags"))?
|
||||
|
Reference in New Issue
Block a user