2022-09-18 03:15:07 +00:00
|
|
|
#include <signal.h>
|
2022-09-18 03:24:31 +00:00
|
|
|
#include <stdio.h>
|
|
|
|
#include <unistd.h>
|
|
|
|
|
|
|
|
static volatile int keepRunning = 1;
|
|
|
|
|
|
|
|
void intHandler(int dummy) {
|
|
|
|
printf("\nend!\n");
|
|
|
|
keepRunning = 0;
|
|
|
|
}
|
2022-09-18 03:15:07 +00:00
|
|
|
|
|
|
|
int main(int argc, char *argv[]) {
|
2022-09-18 03:24:31 +00:00
|
|
|
|
|
|
|
signal(SIGINT, intHandler);
|
|
|
|
|
|
|
|
printf("Hello, World!\n");
|
|
|
|
#ifdef DEBUG
|
|
|
|
printf("DEBUG is defined\n");
|
|
|
|
#endif
|
|
|
|
while (keepRunning) {
|
|
|
|
printf("runing!\n");
|
|
|
|
sleep(1);
|
|
|
|
}
|
|
|
|
return 0;
|
2022-09-18 03:15:07 +00:00
|
|
|
}
|