diff --git a/syscalls/linux.cpp b/syscalls/linux.cpp index 3959a92..1733d63 100644 --- a/syscalls/linux.cpp +++ b/syscalls/linux.cpp @@ -650,9 +650,13 @@ static int linux_nanosleep(SysFrm *, while (time < sleepTime) { + if (pcb->Signals->HasPendingSignal()) + { + debug("sleep interrupted by signal"); + return -EINTR; + } + pcb->GetContext()->Yield(); - /* TODO: sleep should be interrupted by - the signal and return errno EINTR */ time = TimeManager->GetCounter(); } debug("time= %ld", time);