3 exits, _exits, atexit, atexitdont, terminate \- terminate process, process cleanup
11 void _exits(char *msg)
16 int atexit(void(*)(void))
19 void atexitdont(void(*)(void))
23 is the conventional way to terminate a process.
25 also terminates a process but does not call the registered
33 conventionally includes a brief (maximum length
35 explanation of the reason for
36 exiting, or a null pointer or empty string to indicate normal termination.
37 The string is passed to the parent process, prefixed by the name and process
38 id of the exiting process, when the parent does a
47 calls in reverse order all the functions
54 as a function to be called by
56 It returns zero if it failed,
58 A typical use is to register a cleanup routine for an I/O package.
59 To simplify programs that fork or share memory,
62 .IR atexit -registered
63 functions that were registered by the same
64 process as that calling
69 twice (or more) with the same function argument causes
71 to invoke the function twice (or more).
73 There is a limit to the number of exit functions
74 that will be recorded;
76 returns 0 if that limit has been reached.
79 cancels a previous registration of an exit function.
81 .B \*9/src/lib9/atexit.c
83 .B \*9/src/lib9/_exits.c
88 Because of limitations of Unix, the exit status of a
89 process can only be an 8-bit integer.
90 Exit status 0 is used for empty exit messages, and 1 for
93 Exit codes 97 through 99 are used by the thread library to signal
94 internal synchronization errors between the main program
95 and a proxy process that implements backgrounding.
97 To avoid name conflicts with the underlying system,
101 are preprocessor macros defined as