_kexit(2) - Linux man page
Name
kexit, _kexit, atkexit - Terminate LAM process.C Synopsis
int kexit (int errcode);int _kexit (int errcode);
int atkexit (int (*func)(), char *arg);
Fortran Synopsis
subroutine KXIT (errcode)integer errcode
Description
_kexit() may be used instead of kexit() to avoid calling the exit functions.
The argument to kexit() and _kexit() is an exit code which is sent in a message to the parent process, if requested by the parent process when the process was created. See rploadgo(2) and rpwait(2). By convention the exit code is 0 if the process successfully completed.
An exit function is registered by calling atkexit(). The arguments passed to atkexit() are the address of the exit function to be called upon kexit(), and an argument to pass to the exit function when it is called. (Note that the function may ignore the argument, reverting to the ANSI standard C library atexit(3) behavior, where no argument is passable.) There is a limit on how many exit functions may be registered. Exit functions are called in reverse order of their registration. Some system modules register their own cleanup functions.
kexit() eventually calls kdetach(2) to gracefully detach from the LAM daemon and exit(3) to actually terminate within the host operating system.
Return Value
kexit() and _kexit() do not return. Upon successful completion, atkexit() returns 0. Otherwise, -1 is returned and the global variable errno is set to indicate the error.Errors
- ENOEXDESCRIPTORS
- There is no room left in the internal table of exit functions.
