Annotation of OpenXM/src/kan96xx/plugin/mysig.c, Revision 1.1
1.1 ! takayama 1: /* $OpenXM$ */
! 2: #include <stdio.h>
! 3: #include <signal.h>
! 4: #include <unistd.h>
! 5: #include <setjmp.h>
! 6: #include <string.h>
! 7: #include "mysig.h"
! 8:
! 9: int unblock_sigchild_sigint(void) {
! 10: struct sigaction act;
! 11: sigset_t set;
! 12: sigset_t oldset;
! 13: sigemptyset(&set);
! 14: sigaddset(&set,SIGINT);
! 15: sigaddset(&set,SIGCHLD);
! 16: sigprocmask(SIG_UNBLOCK,&set,&oldset);
! 17: return(0);
! 18: }
! 19:
! 20: int set_sigchild(void (*handler)(void)) {
! 21: struct sigaction act;
! 22: struct sigaction oldact;
! 23: act.sa_handler=handler;
! 24: act.sa_flags=0;
! 25: act.sa_flags |= SA_RESTART;
! 26: sigemptyset(&act.sa_mask);
! 27: return(sigaction(SIGCHLD,&act,&oldact));
! 28: }
! 29:
! 30:
! 31:
! 32:
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>