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


6 Signals

The program will terminate normally (that is: will flush and close the file system and release memory) if any of the following signals (if available during compiling) 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, SIGEMT, SIGLOST.

If the program is still working despite sending a signal (like when the program is stuck because of filesystem problems), sending any of these signals again kills the child process (the wiping process) and exits the main program.

The SIGCHLD signal is caught, but doesn’t terminate the program.

If the program receives the SIGKILL signal, it will, of course, be killed. But it won’t be able to close the file system and finish working normally. The file system being worked on could be left in an inconsistent state, errors could show up. Try to avoid stopping the program this way.

You can freeze the program by sending the SIGSTOP signal (like ‘killall -STOP wipefreespace’) 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 wipefreespace’). 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.