exit(2)

exit2

Terminate the calling thread

Usage

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

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

Library

Standard C library (libc, -lc)

Overview

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.

Releases

19 releases since Debian 1.1 (Buzz); the text changed 16 times.

  1. 1.1–1.2
  2. 1.3
  3. 2.0–2.1
  4. 2.2
  5. 3.0
  6. 3.1
  7. 4.0
  8. 5.0
  9. 6.0
  10. 7
  11. 8
  12. 9
  13. 10
  14. 11
  15. 12
  16. 13
  17. Arch

Standards

Linux.

History

Linux.

From man-pages 6.19-1 in Arch Linux 2026-11-01. Parsed by carta from the page's man source.