Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int signal_view_usr1(void (*handler)(int)) {
- sigset_t set;
- struct sigaction sa;
- ec_meno1( sigemptyset(&set) );
- ec_meno1( sigaddset(&set, SIGUSR1) );
- ec_nzero( pthread_sigmask(SIG_UNBLOCK, &set, NULL) );
- if (handler != NULL) {
- memset(&sa, 0, sizeof(sa));
- sa.sa_handler = (*handler);
- ec_meno1( sigaction(SIGUSR1, &sa, NULL) );
- }
- return 0;
- EC_CLEANUP_BGN
- return -1;
- EC_CLEANUP_END
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement