头文件中SIGUNUSED的确切位置在哪里?
作者:互联网
我有一些必须针对多个平台进行编译的代码.下面将使代码编译,但是我想知道SIGUNUSED符号的实际定义位置:
工作守则
#ifdef LINUX
#define SIGEMT SIGUNUSED
#endif
…
void set_sig_trap()
{
signal( SIGHUP, Signal ); /* floating point exception */
signal( SIGINT , Signal ); /* Interrupt */
signal( SIGQUIT, Signal ); /* quit */
signal( SIGILL, Signal ); /* Illegal instruction */
signal( SIGTRAP, Signal ); /* trace trap */
signal( SIGABRT, Signal ); /* Process abort signal */
signal( SIGEMT, Signal ); /* EMT instruction */
signal( SIGFPE, Signal ); /* Floating point exception */
signal( SIGBUS, Signal ); /* bus error */
signal( SIGSEGV, Signal ); /* Segmentation violation */
signal( SIGSYS, Signal ); /* bad argument to system call */
signal( SIGPIPE, Signal ); /* write on a pipe - no one to read it */
signal( SIGTERM, Signal ); /* Software termination sig. from kill */
signal( SIGALRM, Signal ); /* alarm clock */
return;
}
…
我在/usr/include中寻找SIGUNUSED,没有任何点击.它不在signal.h中.它来自哪里?
更新:
我不认为信号定义会在signal.h之外,因为响应表明递归搜索确实找到了定义:
me@mymachine.:/usr/include $grep -d recurse SIGUNUSED *
asm/signal.h:#define SIGUNUSED 31
asm-arm/signal.h:#define SIGUNUSED 31
asm-ia64/signal.h:/* signal 31 is no longer "unused", but the SIGUNUSED macro remains for backwards compatibility */
asm-ia64/signal.h:#define SIGUNUSED 31
asm-parisc/signal.h:#define SIGUNUSED 31
asm-parisc/signal.h:#define SIGRESERVE SIGUNUSED
asm-powerpc/signal.h:#define SIGUNUSED 31
asm-s390/signal.h:#define SIGUNUSED 31
asm-x86/signal.h:#define SIGUNUSED 31
bits/signum.h:#define SIGUNUSED 31
谢谢!
解决方法:
我看到它在bits / signum.h中定义,其中包含在signal.h中:
#define SIGUNUSED 31
也许您忘记了递归grep?
标签:c-3,linux,signals 来源: https://codeday.me/bug/20191209/2095635.html