I have the following code:
#include #include #include pthread_t test_thread; void *thread_test_run (void *v)
Because killall sends the signal SIGTERM by default, you can handle this type of signal.
killall
SIGTERM
#include void handler(int sig) { /* ... */ } signal (SIGTERM, handler);