- [Linux定义信号的一些细节处理-自定义信号变量]https://blog.csdn.net/renlonggg/article/details/78309662
#define MY_SINGL_1 (SIGRTMIN + 1)
/*
信号函数,发送接受
*/
void signal_handler(int signalnum)
{
printf("Get signal %d.\n", signalnum);
}
void signal_main(void)
{
int num = 0;
signal(MY_SINGL_1, signal_handler);
while (1)
{
printf("Wait ......\n");
sleep(1);
num++;
if (num >= 3)
{
num = 0;
raise(MY_SINGL_1);
break;
}
}
}
标签:APUE,自定义,signal,num,MY,void,SINGL
From: https://www.cnblogs.com/starcos/p/17549441.html