man.bsd.lv manual page server

Manual Page Search Parameters

EXTEXIT(2) System Calls Manual EXTEXIT(2)

extexitterminate the calling lwp or process and perform action

library “libc”

#include <unistd.h>

void
extexit(int how, int status, void *addr);

The () function terminates a lwp or process and performs an action. This is a low level service routine not intended to be used from common user code.

The () function can be used to either exit a lwp or a complete process. This is done by specifying either EXTEXIT_PROC or EXTEXIT_LWP in how. If exiting the process or if exiting the last lwp of a process, extexit() behaves like _exit(2) called with the status argument.

Additionally, () can be used to perform certain actions when exiting. The following actions can be specified by 'ing these values in the how argument:

Set the integer variable pointer to by addr to the value of status. This is intended to enable other threads or processes to detect the termination of the calling lwp or process.

The extexit() function will only return if it was invoked with invalid arguments. In this case, errno will be set to EINVAL. In the case of a successful invocation, extexit() will not return.

In case of an error, the action specified in how will not be performed. If an error occurs while performing an action, the results are undefined. However, extexit() will try hard to avoid such a situation. In any case, if an error occurs while performing an action, extexit() will return.

_exit(2), wait(2), exit(3)

The extexit() function first appeared in DragonFly 1.9.

February 24, 2007 DragonFly-5.6.1