include <stdio.h>
include <signal.h>
void my_signal(int signum)
{
static unsigned int cnt;
printf("signum = %d, %d timer\n",signum ,++cnt);//liunx 命令行中是行缓冲的。
}
int main(int argc,char **argv)
{
signal(SIGUSR1,my_signal);
while(1)
{
sleep(1000);
}
return 0;
}