Catching signal inside its own handler

后端 未结 5 669
抹茶落季
抹茶落季 2021-01-11 10:41
#include
#include

void handler(int signo)
{
    printf(\"Into handler\\n\");
    while(1);
}
int main()
{
    struct sigaction act;
          


        
5条回答
  •  暖寄归人
    2021-01-11 11:17

    The "while(1)" in handler is preventing the first service call from ever returning. Remove that and subsequent interrupts should cause handler to be called again.

    An interrupt service routine should not prevent the calling thread from returning.

提交回复
热议问题