由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Unix版 - question about UNIX Signal
相关主题
linux下跑得正常Unix下出错怎样写 makefile
[转载] 请教:UNIX下process之间的signal问题一个计算机学术网站
[转载] SIGTSTPRe: 菜鸟问题:UNIX下怎么改文件的日期?
[转载] help!!! recvfrom() doens't terminatecoconut 申请 unix BZ
pthread_kill SIGINT SIG_DFL multithread请问在UNIX中该如何设screensaver
Re: 为什么emacs自动给我加^M.Unix下怎么解加密的.zip文件?
Re: Where to download MP3 player for UNIX?UNIX下编程求助
Re: unix下怎么把一个大文件分成若干个小文件?Help -- How to display the list of available printers
相关话题的讨论汇总
话题: signal话题: handler话题: unix话题: process话题: when
进入Unix版参与讨论
1 (共1页)
j*******e
发帖数: 674
1
I install a signal handler for a process.
The handler will catch all the signals except 9 and 23, and do nothing but
"print", and so on.
I found out that that: When the process receive the same signal for a second
time, the handler will not function anymore. And default action for that
signal will take effect.
I can't find any book mention such problem.
Is this a bug in my program, or it is the way that signal works?
m*****e
发帖数: 4193
2

This is how signal works on some Unix platform. You need to catch the signal
again in your signal handler.

【在 j*******e 的大作中提到】
: I install a signal handler for a process.
: The handler will catch all the signals except 9 and 23, and do nothing but
: "print", and so on.
: I found out that that: When the process receive the same signal for a second
: time, the handler will not function anymore. And default action for that
: signal will take effect.
: I can't find any book mention such problem.
: Is this a bug in my program, or it is the way that signal works?

o***z
发帖数: 133
3
If you set SA_RESETHAND and the signal is caught,
the disposition of the signal is automatically reset to SIG_DFL

【在 j*******e 的大作中提到】
: I install a signal handler for a process.
: The handler will catch all the signals except 9 and 23, and do nothing but
: "print", and so on.
: I found out that that: When the process receive the same signal for a second
: time, the handler will not function anymore. And default action for that
: signal will take effect.
: I can't find any book mention such problem.
: Is this a bug in my program, or it is the way that signal works?

p******f
发帖数: 162
4

If you are using signal(2), change to sigaction(2).

【在 j*******e 的大作中提到】
: I install a signal handler for a process.
: The handler will catch all the signals except 9 and 23, and do nothing but
: "print", and so on.
: I found out that that: When the process receive the same signal for a second
: time, the handler will not function anymore. And default action for that
: signal will take effect.
: I can't find any book mention such problem.
: Is this a bug in my program, or it is the way that signal works?

1 (共1页)
进入Unix版参与讨论
相关主题
Help -- How to display the list of available printerspthread_kill SIGINT SIG_DFL multithread
[公告] Unix 板的投票结果Re: 为什么emacs自动给我加^M.
切磋切磋, 高手们都是怎么学的UNIX?Re: Where to download MP3 player for UNIX?
怎么在UNIX下面放CD?Re: unix下怎么把一个大文件分成若干个小文件?
linux下跑得正常Unix下出错怎样写 makefile
[转载] 请教:UNIX下process之间的signal问题一个计算机学术网站
[转载] SIGTSTPRe: 菜鸟问题:UNIX下怎么改文件的日期?
[转载] help!!! recvfrom() doens't terminatecoconut 申请 unix BZ
相关话题的讨论汇总
话题: signal话题: handler话题: unix话题: process话题: when