exit(2) — Linux manual page

NAME | LIBRARY | SYNOPSIS | DESCRIPTION | RETURN VALUE | STANDARDS | HISTORY | SEE ALSO | COLOPHON

exit(2)                    System Calls Manual                    exit(2)

NAME         top

       exit - terminate the calling thread

LIBRARY         top

       Standard C library (libc, -lc)

SYNOPSIS         top

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

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

DESCRIPTION         top

       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         top

       exit() does not return.

STANDARDS         top

       Linux.

HISTORY         top

       Linux.

SEE ALSO         top

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

COLOPHON         top

       This page is part of the man-pages (Linux kernel and C library
       user-space interface documentation) project.  Information about
       the project can be found at 
       ⟨https://www.kernel.org/doc/man-pages/⟩.  If you have a bug report
       for this manual page, see
       ⟨https://git.kernel.org/pub/scm/docs/man-pages/man-pages.git/tree/CONTRIBUTING⟩.
       This page was obtained from the tarball man-pages-6.19.tar.gz
       fetched from
       ⟨https://mirrors.edge.kernel.org/pub/linux/docs/man-pages/⟩ on
       2026-09-09.  If you discover any rendering problems in this HTML
       version of the page, or you believe there is a better or more up-
       to-date source for the page, or you have corrections or
       improvements to the information in this COLOPHON (which is not
       part of the original manual page), send a mail to
       man-pages@man7.org

Linux man-pages 6.19            2026-06-05                        exit(2)

Pages that refer to this page: exit_group(2)fork(2)syscalls(2)exit(3)_exit(3)pmgetconfig(3)pmnomem(3)