blob: d174b8e4a3b9ff95aac37b162ee733dda25ebe93 [file] [log] [blame]
/*
* __signal.c
*/
#include <signal.h>
__sighandler_t __signal(int signum, __sighandler_t handler, int flags)
{
struct sigaction sa;
sa.sa_handler = handler;
sa.sa_flags = flags;
sigemptyset(&sa.sa_mask);
if (sigaction(signum, &sa, &sa)) {
return (__sighandler_t) SIG_ERR;
} else {
return (__sighandler_t) sa.sa_handler;
}
}