开发者

Catching a signal in linux

I am working on Linux.

I wrote a function that is called when an SIGSEGV is sent.

I check my program by sending from command prompt kill -SIGSEGV pid.

I remark that when my program is not polling for new ethernet input, it doesn't catch the signal and enter 'zombie state' i.e. it d开发者_运维百科oesn't write nothing to log file...

Is there a logic explanation why program doesn't always catch signals ?


You can create one thread that will only "listen" for SIGSEVG signal and another one that will only poll for new internet input.

This way your program won't "miss" SIGSEVG signal while polling for new ethernet input.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜