1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 00:17:46 +00:00

LibC: Implement siginterrupt()

This is just a simple wrapper around the more-modern sigaction.
This commit is contained in:
Idan Horowitz 2023-12-25 15:43:56 +02:00 committed by Andreas Kling
parent 5e2fc52b25
commit 8bb423daf7
2 changed files with 15 additions and 0 deletions

View file

@ -102,6 +102,20 @@ int sigdelset(sigset_t* set, int sig)
return 0;
}
// https://pubs.opengroup.org/onlinepubs/009696699/functions/siginterrupt.html
int siginterrupt(int sig, int flag)
{
struct sigaction act;
int rc = sigaction(sig, nullptr, &act);
if (rc < 0)
return rc;
if (flag)
act.sa_flags &= ~SA_RESTART;
else
act.sa_flags |= SA_RESTART;
return sigaction(sig, &act, nullptr);
}
// https://pubs.opengroup.org/onlinepubs/9699919799/functions/sigismember.html
int sigismember(sigset_t const* set, int sig)
{