mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 19:57:45 +00:00
LibC: Implement sigwait()
This is done internally by just calling the more modern sigtimedwait syscall and then massaging the results to fit sigwait's interface.
This commit is contained in:
parent
640844c965
commit
656b1dd6be
2 changed files with 12 additions and 0 deletions
|
@ -163,6 +163,17 @@ int sigsuspend(const sigset_t* set)
|
|||
return pselect(0, nullptr, nullptr, nullptr, nullptr, set);
|
||||
}
|
||||
|
||||
// https://pubs.opengroup.org/onlinepubs/009604499/functions/sigwait.html
|
||||
int sigwait(sigset_t const* set, int* sig)
|
||||
{
|
||||
int rc = syscall(Syscall::SC_sigtimedwait, set, nullptr, nullptr);
|
||||
VERIFY(rc != 0);
|
||||
if (rc < 0)
|
||||
return -rc;
|
||||
*sig = rc;
|
||||
return 0;
|
||||
}
|
||||
|
||||
// https://pubs.opengroup.org/onlinepubs/9699919799/functions/sigwaitinfo.html
|
||||
int sigwaitinfo(sigset_t const* set, siginfo_t* info)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue