Linux????е???????--???????????
???????????? ???????[ 2013/2/26 10:03:25 ] ????????
????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()???ú????????????????????彲??
??????
???·???
??????????????????
2023/3/23 14:23:39???д?ò??????????
2023/3/22 16:17:39????????????????????Щ??
2022/6/14 16:14:27??????????????????????????
2021/10/18 15:37:44???????????????
2021/9/17 15:19:29???·???????·
2021/9/14 15:42:25?????????????
2021/5/28 17:25:47??????APP??????????
2021/5/8 17:01:11