mirror of
https://github.com/SerenityOS/serenity.git
synced 2025-01-24 10:22:05 -05:00
Kernel: clock_nanosleep's 'flags' is not a bitset
This had the interesting effect that most, but not all, non-zero values were interpreted as an absolute value.
This commit is contained in:
parent
e1db8094b6
commit
546cdde776
1 changed files with 11 additions and 1 deletions
|
@ -76,7 +76,17 @@ int Process::sys$clock_nanosleep(Userspace<const Syscall::SC_clock_nanosleep_par
|
|||
if (!copy_from_user(&requested_sleep, params.requested_sleep))
|
||||
return -EFAULT;
|
||||
|
||||
bool is_absolute = params.flags & TIMER_ABSTIME;
|
||||
bool is_absolute;
|
||||
switch (params.flags) {
|
||||
case 0:
|
||||
is_absolute = false;
|
||||
break;
|
||||
case TIMER_ABSTIME:
|
||||
is_absolute = true;
|
||||
break;
|
||||
default:
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
if (!TimeManagement::is_valid_clock_id(params.clock_id))
|
||||
return -EINVAL;
|
||||
|
|
Loading…
Add table
Reference in a new issue