mirror of
https://github.com/RGBCube/serenity
synced 2025-07-24 22:17:42 +00:00
Kernel: If a process is interrupted during usleep(), return -EINTR
This commit is contained in:
parent
ac2cc7d78f
commit
2c693094d9
1 changed files with 2 additions and 5 deletions
|
@ -1514,12 +1514,9 @@ int Process::sys$usleep(useconds_t usec)
|
||||||
{
|
{
|
||||||
if (!usec)
|
if (!usec)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
u64 wakeup_time = current->sleep(usec / 1000);
|
u64 wakeup_time = current->sleep(usec / 1000);
|
||||||
if (wakeup_time > g_uptime) {
|
if (wakeup_time > g_uptime)
|
||||||
u32 ticks_left_until_original_wakeup_time = wakeup_time - g_uptime;
|
return -EINTR;
|
||||||
return ticks_left_until_original_wakeup_time / TICKS_PER_SECOND;
|
|
||||||
}
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue