exit (system call)

More generally, an exit in a multithreading environment means that a thread of execution has stopped running.

When the child process terminates ("dies"), either normally by calling exit, or abnormally due to a fatal exception or signal (e.g., SIGTERM, SIGINT, SIGKILL), an exit status is returned to the operating system and a SIGCHLD signal is sent to the parent process.

Typically this is an integer value, although some operating systems (e.g., Plan 9 from Bell Labs) allow a character string to be returned.

Still other systems (e.g., IBM z/OS and its predecessors) use ranges of integer values to indicate success, warning, and error completion results.

It is sometimes possible to bypass the usual cleanup; C99 offers the _exit() function which terminates the current process without any extra program clean-up.