Add copyright
[unix-history] / usr / src / lib / libc / sys / _exit.2
CommitLineData
5623bdc2
KM
1.\" Copyright (c) 1980 Regents of the University of California.
2.\" All rights reserved. The Berkeley software License Agreement
3.\" specifies the terms and conditions for redistribution.
4.\"
65001f7a 5.\" @(#)_exit.2 6.1 (Berkeley) %G%
5623bdc2 6.\"
65001f7a 7.TH EXIT 2 ""
5623bdc2
KM
8.UC 4
9.SH NAME
69ee3f0e 10_exit \- terminate a process
5623bdc2
KM
11.SH SYNOPSIS
12.nf
69ee3f0e
KM
13.ft B
14_exit(status)
15int status;
5623bdc2
KM
16.fi
17.SH DESCRIPTION
69ee3f0e
KM
18.I _exit
19terminates a process with the following consequences:
20.in +5n
5623bdc2 21.PP
69ee3f0e 22All of the descriptors open in the calling process are closed.
5623bdc2 23.PP
69ee3f0e
KM
24If the parent process of the calling process is executing a
25.I wait
26or is interested in the SIGCHLD signal,
27then it is notified of the calling process's termination and
28the low-order eight bits of \fIstatus\fP are made available to it;
29see
30.IR wait (2).
31.PP
32The parent process ID of all of the calling process's existing child
33processes are also set to 1. This means that the initialization process
34(see
35.IR intro (2))
36inherits each of these processes as well.
37.in -5n
38.PP
39Most C programs call the library routine
40.IR exit (3)
41which performs cleanup actions in the standard i/o library before
42calling \fI_exit\fP\|.
43.SH "RETURN VALUE"
44This call never returns.
5623bdc2 45.SH "SEE ALSO"
69ee3f0e 46fork(2), wait(2), exit(3)