????1?????

????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????к???????????????????????????????signal()??sigaction()??

????2??signal()

????signal()???????????£?

void (*signal(int signum?? void (*handler)(int)))(int);

??????????????????м?????????????

#include <signal.h>

?????????????????????????????????????????????????????????????????????POSIX????壩??

typedef void (*sighandler_t)(int);
sighandler_t signal(int signum?? sighandler_t handler);

???????????????????????в??????????壬?????????????????????ο?????????????У?????signum?????????????????????????????handler????????????????????

?????? SIG_IGN?????????signum?????????

?????? SIG_DFL?????????signum????????????????????

???????????????????????????????????????????????????????????????????????????signal()?????????????signum???ε?????????????????????????SIG_ERR??

????signal()?????????sys_signal()?????????????????????????????sys_signal()???????£?

/*
 * For backwards compatibility.  Functionality superseded by sigaction.
 */
asmlinkage unsigned long
sys_signal(int sig?? __sighandler_t handler)
{
 struct k_sigaction new_sa?? old_sa;
 int ret;

 new_sa.sa.sa_handler = handler;
 new_sa.sa.sa_flags = SA_ONESHOT | SA_NOMASK;

 ret = do_sigaction(sig?? &new_sa?? &old_sa);

 return ret ? ret : (unsigned long)old_sa.sa.sa_handler;
}

????__sighandler_t????????£?

typedef void __signalfn_t(int);
typedef __signalfn_t __user *__sighandler_t;

?????????sys_signal()???????????????????????????????????????????sys_signal()?????????????????????k_sigaction??????????do_sigaction()???ú????????????????????彲??