qfedu-linux-advanced-level/day3/t18.c

18 lines
299 B
C

#include <stdio.h>
#include <signal.h>
#include <sys/types.h>
#include <unistd.h> // sleep
int main()
{
printf("2秒后挂起, 等待信号 SIGINT\n");
sleep(2);
if (f = pause() == -1)
{
printf("pause error\n");
}
else
{
printf("pause return\n");
}
}