#include #include /* Empty a signal set */ int sigemptyset(sigset_t *set) { *set = 0; return 0; } /* Fill a signal set */ int sigfillset(sigset_t *set) { *set = 0xFFFFFFFF; return 0; } /* Add a signal to a signal set */ int sigaddset(sigset_t *set, int signum) { if (signum < 0 || signum >= 32) { errno = EINVAL; return -1; } *set |= (1 << (signum - 1)); return 0; } /* Remove a signal from a signal set */ int sigdelset(sigset_t *set, int signum) { if (signum < 0 || signum >= 32) { errno = EINVAL; return -1; } *set &= ~(1 << (signum - 1)); return 0; } /* Check if a signal is in a signal set */ int sigismember(const sigset_t *set, int signum) { if (signum < 0 || signum >= 32) { errno = EINVAL; return -1; } return (*set & (1 << (signum - 1))); }