Linux:如何查看活动进程是否设置了信号处理程序?
有一个进程正在快乐地运行,我想知道它是否设置了一些信号处理程序。 我记得我曾经在某处读过有关此的内容,但找不到此类信息。是否可以?
谢谢
There is a process happy running and I wonder if it has set some signal handlers.
I recall I have once read something about this somewhere but could not find such information. Is it possible?
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
一定喜欢这一点 - 大概这些实际上是信号集...
cat /proc/self/status | grep -i '^Sig'
似乎可以制作一个实用程序来打印这些内容 - 除非有人已经知道了?
阅读一些 procfs 的内核代码了
嗯 - 是时候从这篇优秀的文章中
: http://kernel.org/doc/Documentation /filesystems/proc.txt
gotta love that - presumably these are actually the signal sets...
cat /proc/self/status | grep -i '^Sig'
would seem could make a utility to print those out - unless anyone know of one already?
hmmm - time to read some kernel code for procfs
from this excellent article:
http://kernel.org/doc/Documentation/filesystems/proc.txt
您可以在检查
/proc/PID/status
文件时检测到这一点。SigCgt
掩码显示应用程序捕获的信号。 (参见man 7 signal
sigmask 解释)you can detect this while checking the
/proc/PID/status
file.The
SigCgt
mask display the caught signals by your application. (seeman 7 signal
for sigmask explanations)