Skip to content

Commit

Permalink
feat(signal): implement sigisemptyset and sigfillset
Browse files Browse the repository at this point in the history
JIRA: RTOS-904
  • Loading branch information
badochov committed Sep 6, 2024
1 parent ce2afa9 commit 96c4c08
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions signal/signal.c
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,12 @@ int sigsuspend(const sigset_t *sigmask)

int sigfillset(sigset_t *set)
{
return -ENOSYS;
if (set == NULL) {
return SET_ERRNO(-EINVAL);
}

memset(set, ~0, sizeof(sigset_t));
return 0;
}


Expand Down Expand Up @@ -365,7 +370,15 @@ int sigemptyset(sigset_t *set)

int sigisemptyset(sigset_t *set)
{
return -ENOSYS;
sigset_t empty;

if (set == NULL) {
return SET_ERRNO(-EINVAL);
}

(void)sigemptyset(&empty);

return (memcmp(set, &empty, sizeof(sigset)) == 0);
}


Expand Down

0 comments on commit 96c4c08

Please sign in to comment.