Next: , Previous: , Up: Top   [Contents]


5 Signals

The program will terminate normally (that is: will close the file and the library) if any of the following signals are caught: SIGINT (Ctrl+C), SIGQUIT, SIGILL, SIGABRT, SIGFPE, SIGSEGV, SIGPIPE, SIGALRM, SIGTERM, SIGUSR1, SIGUSR2, SIGTTIN, SIGTTOU, SIGBUS, SIGPOLL, SIGPROF, SIGSYS, SIGTRAP, SIGXCPU, SIGXFSZ, SIGPWR, SIGVTALRM, SIGUNUSED, SIGCHLD, SIGEMT, SIGIO and SIGLOST.

If the program receives the SIGKILL signal, it will, of course, be killed. But it won’t be able to close the file and the library and finish working normally. Try to avoid stopping the program this way.

You can freeze the program by sending the SIGSTOP signal (like ‘killall -STOP imyplay’) to it or by pressing Ctrl+Z in the terminal on which the program is running. The program will continue if it receives the SIGCONT signal (like with ‘killall -CONT imyplay’). You can still send other signals to it, if you wish to terminate it.

NOTE: for signal handling to work, your compiler probably needs a working ‘volatile’ data type. If you are using GCC, no worries.