#include <signal.h>
#include <iostream>
#include <thread>
#include <chrono>
void sigint_handler(int signo) {
if (signo == SIGINT) {
printf("received SIGINT, aborting abruptly
");
abort();
}
}
int main() {
signal(SIGINT, sigint_handler);
while (true) {
std::cout << "Loop..." << std::endl;
std::this_thread::sleep_for(std::chrono::milliseconds(500));
}
}