What is correct way to have single Signal Handler function for multiple Signals?

前端 未结 3 1481
野趣味
野趣味 2021-01-02 07:03

What is the best way in C on Linux for setting up a program that can handle multiple POSIX-signals with the same function?

For example in my code I have a handler fu

3条回答
  •  無奈伤痛
    2021-01-02 07:20

    "signum" parameter of "sigaction" system call is an integer value, which does not work as a flag.

    As far as I know, there's no way to assign one handler function for several signals in one call.

提交回复
热议问题