It's A Trap!
#include
#include
#include
void theShieldIsUp (int param) {
raise(SIGABRT);
}
void ackbar (int param) {
std::cout << "It's A Trap!" << std::endl;
exit(1);
}
int main () {
signal(SIGTERM, theShieldIsUp);
signal(SIGABRT, ackbar);
while(true)
sleep(1);
return 0;
}
This was really funny to me earlier when I jotted it down. It's a signal trap that calls a function that raises a process abort signal. Get it? Yeah, not as good as it was when I was working on it...