Kernel/LibC: Implement sigsuspend

This commit is contained in:
2025-08-20 20:14:54 +03:00
parent 49122cf729
commit 247743ef9c
6 changed files with 38 additions and 0 deletions

View File

@@ -2651,6 +2651,20 @@ namespace Kernel
return 0;
}
BAN::ErrorOr<long> Process::sys_sigsuspend(const sigset_t* set)
{
LockGuard _(m_process_lock);
TRY(validate_pointer_access(set, sizeof(sigset_t), false));
auto& thread = Thread::current();
thread.set_suspend_signal_mask(*set & ~(SIGKILL | SIGSTOP));
while (!thread.is_interrupted_by_signal())
Processor::scheduler().block_current_thread(nullptr, -1, &m_process_lock);
return BAN::Error::from_errno(EINTR);
}
BAN::ErrorOr<long> Process::sys_futex(int op, const uint32_t* addr, uint32_t val, const timespec* abstime)
{
const vaddr_t vaddr = reinterpret_cast<vaddr_t>(addr);