| exits, _exits, atexit, atexitdont, terminate \- terminate process, process cleanup |
| int atexit(void(*)(void)) |
| void atexitdont(void(*)(void)) |
| is the conventional way to terminate a process. |
| is the underlying system call. |
| conventionally includes a brief (maximum length |
| explanation of the reason for |
| exiting, or a null pointer or empty string to indicate normal termination. |
| The string is passed to the parent process, prefixed by the name and process |
| id of the exiting process, when the parent does a |
| calls in reverse order all the functions |
| as a function to be called by |
| It returns zero if it failed, |
| A typical use is to register a cleanup routine for an I/O package. |
| To simplify programs that fork or share memory, |
| functions that were registered by the same |
| twice (or more) with the same function argument causes |
| to invoke the function twice (or more). |
| There is a limit to the number of exit functions |
| returns 0 if that limit has been reached. |
| cancels a previous registration of an exit function. |
| .B /usr/local/plan9/src/libc/port/atexit.c |