关于SIGKILL SIGQUIT

本文详细介绍了Linux系统中的信号量,包括SIGQUIT和SIGKILL在内的多种信号的作用及应用场景。解释了不同信号如何影响进程的行为,例如SIGKILL信号无法被进程捕获或忽略,并且接收到该信号的进程无法执行任何清理操作。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

SIGQUIT       3       Core    Quit from keyboard

SIGKILL       9       Term    Kill signal

SIGQUIT 可以用ctrl+\ 发送给当前进程,退出时产生core dump。
SIGKILL被发送给一个程序时,它使程序立即终止。与SIGTERM和SIGINT相比,这个信号不能被捕获或忽略,同时接收这个信号的进程在收到这个信号时不能执行任何清理。

9是信号量,kill实际上是用来发送信号量给进程,你可以通过man kill查看信号量列表,这里给你一个我获得的信号量列表:
       Name     Num   Action    Description
       0          0   n/a       exit code indicates if a signal may be sent
       ALRM      14   exit
       HUP        1   exit
       INT        2   exit
       KILL       9   exit      cannot be blocked
       PIPE      13   exit
       POLL           exit
       PROF           exit
       TERM      15   exit
       USR1           exit
       USR2           exit
       VTALRM         exit
       STKFLT         exit      might not be implemented
       PWR            ignore    might exit on some systems
       WINCH          ignore
       CHLD           ignore
       URG            ignore
       TSTP           stop      might interact with the shell
       TTIN           stop      might interact with the shell
       TTOU           stop      might interact with the shell
       STOP           stop      cannot be blocked
       CONT           restart   continue if stopped, otherwise ignore
       ABRT       6   core
       FPE        8   core
       ILL        4   core
       QUIT       3   core
       SEGV      11   core
       TRAP       5   core
       SYS            core      might not be implemented
       EMT            core      might not be implemented
       BUS            core      core dump might fail
       XCPU           core      core dump might fail
       XFSZ           core      core dump might fail
参考

http://bbs.chinaunix.net/thread-1919869-1-1.html

http://zhidao.baidu.com/link?url=KA77oyYFGC0L423AiuQa7wsTrSBYSEiDYES99SfVD2oHifQBjq1eAopGJMDuR89cXMNPacoXAd5JJzv8NAQstq

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值