Skip to content
Advertisement

Signal Handling C programming on ubuntu

While I sending kill -9 command to a program on ubuntu , I want to close other running processes before the program closes.I am trying this with c programming . Could it be something like this? How can I say program if you get KILL command you should do something?

Advertisement

Answer

Per the POSIX standard <signal.h> documentation:

The following signals shall be supported on all implementations (default actions are explained below the table):

Signal   Default Action  Description
....
SIGKILL  T               Kill (cannot be caught or ignored).

Note well the “cannot be caught or ignored”.

Your process never “sees” SIGKILL as the OS just kills the process without any notice.

User contributions licensed under: CC BY-SA
9 People found this is helpful
Advertisement