1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 16:37:35 +00:00

Some improvements to signals.

- Add sigprocmask() and sigpending().
- Forked children inherit signal dispositions and masks.
- Exec clears signal dispositions and masks.
This commit is contained in:
Andreas Kling 2018-11-10 23:29:07 +01:00
parent c97a5862ce
commit 6a0a2c9ab4
7 changed files with 60 additions and 4 deletions

View file

@ -71,6 +71,18 @@ int sigismember(const sigset_t* set, int sig)
return 0;
}
int sigprocmask(int how, const sigset_t* set, sigset_t* old_set)
{
int rc = Syscall::invoke(Syscall::SC_sigprocmask, (dword)how, (dword)set, (dword)old_set);
__RETURN_WITH_ERRNO(rc, rc, -1);
}
int sigpending(sigset_t* set)
{
int rc = Syscall::invoke(Syscall::SC_sigpending, (dword)set);
__RETURN_WITH_ERRNO(rc, rc, -1);
}
const char* sys_siglist[NSIG] = {
#undef __SIGNAL
#define __SIGNAL(a, b) b,
@ -78,5 +90,4 @@ const char* sys_siglist[NSIG] = {
#undef __SIGNAL
};
}