exit(2)

NAME
exit - terminate the calling thread

LIBRARY
Standard C library (libc, -lc)

SYNOPSIS
#include <sys/syscall.h>  /* Definition of SYS_* constants */
#include <unistd.h>

[[noreturn]] long syscall(SYS_exit, int status);

DESCRIPTION
exit() terminates the calling thread.

By contrast with _exit(3), the exit() system call terminates only the calling thread, and actions such as reparenting child processes or sending SIGCHLD to the parent process are performed only if this is the last thread in the thread group.

RETURN VALUE
exit() does not return.

STANDARDS
Linux.

HISTORY
Linux.

SEE ALSO
exit_group(2), _exit(3), exit(3), pthread_exit(3)