【问题标题】:How can i see name of signal received from child?如何查看从孩子那里收到的信号名称?
【发布时间】:2016-10-28 01:18:49
【问题描述】:

例如:

if (WIFEXITED(status)) {
              printf("Im child, finish with status=%d\n", WEXITSTATUS(status));

是否可以使用信号名称而不是编号?

【问题讨论】:

    标签: c unix signals


    【解决方案1】:

    仅供参考

    WIFEXITED(status)
    Description:
     Returns True if status was returned for a child that terminated normally. In this case, we can
     execute WEXITSTATUS(status) to fetch the value that the child passed to exit, _exit,or _Exit.
    

    【讨论】:

    • 感谢信息,孩子可以通过各种值退出,我只是想知道是否有办法打印信号名称,如 SIGINT、SIGUSR1
    • 是的。您也可以这样做,但为此您必须修改信号表并添加自己的 ISR。
    猜你喜欢
    • 2014-11-18
    • 2015-05-24
    • 1970-01-01
    • 2022-01-22
    • 1970-01-01
    • 1970-01-01
    • 2022-08-10
    • 2020-06-17
    • 2015-07-18
    相关资源
    最近更新 更多