信号处理,sigaction返回errno 2

时间:2017-11-29 12:41:27

标签: c macos

任何想法为什么sigaction会设置errno 2?

这是我的代码

struct sigaction act;
struct sigaction oldact;

act.sa_sigaction = my_handler;
act.sa_flags = SA_RESTART | SA_SIGINFO | SA_64REGSET;

sigfillset(&sa.sa_mask);

if (sigaction(SIGBUS, &act, &oldact) != -1) {
    printf("[-] failed to install signal handler, %d", errno);
}

0 个答案:

没有答案