开发者

Catching a signal in linux

开发者 https://www.devze.com 2023-03-19 00:00 出处:网络
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 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

精彩评论

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