Mac Developer Library Developer


This manual page is part of Xcode Tools version 5.0

To obtain these tools:

If you are running a version of Xcode Tools other than 5.0, view the documentation locally:

  • In Xcode

  • In Terminal, using the man(1) command

Reading manual pages

Manual pages are intended as a quick reference for people who already understand a technology.

  • To learn how the manual is organized or to learn about command syntax, read the manual page for manpages(5).

  • For more information about this technology, look for other documentation in the Apple Developer Library.

  • For general information about writing shell scripts, read Shell Scripting Primer.

EXIT(2)                     BSD System Calls Manual                    EXIT(2)

     _exit -- terminate the calling process

     #include <unistd.h>

     _exit(int status);

     The _exit() function terminates a process, with the following consequences:

     •   All of the descriptors that were open in the calling process are closed.  This may entail delays;
         for example, waiting for output to drain.  A process in this state may not be killed, as it is
         already dying.

     •   If the parent process of the calling process has an outstanding wait call or catches the SIGCHLD
         signal, it is notified of the calling process's termination; the status is set as defined by

     •   The parent process-ID of all of the calling process's existing child processes are set to 1; the
         initialization process (see the DEFINITIONS section of intro(2)) inherits each of these processes.

     •   If the termination of the process causes any process group to become orphaned (usually because the
         parents of all members of the group have now exited; see ``orphaned process group'' in intro(2)),
         and if any member of the orphaned group is stopped, the SIGHUP signal and the SIGCONT signal are
         sent to all members of the newly-orphaned process group.

     •   If the process is a controlling process (see intro(2)), the SIGHUP signal is sent to the foreground
         process group of the controlling terminal.  All current access to the controlling terminal is

     Most C programs call the library routine exit(3), which flushes buffers, closes streams, unlinks tempo-rary temporary
     rary files, etc., before calling _exit().

     _exit() can never return.

     fork(2), sigaction(2), wait(2), exit(3)

     The _exit function is defined by IEEE Std 1003.1-1988 (``POSIX.1'').

4th Berkeley Distribution        June 4, 1993        4th Berkeley Distribution

Reporting Problems

The way to report a problem with this manual page depends on the type of problem:

Content errors
Report errors in the content of this documentation with the feedback links below.
Bug reports
Report bugs in the functionality of the described tool or API through Bug Reporter.
Formatting problems
Report formatting mistakes in the online version of these pages with the feedback links below.