Commit | Line | Data |
---|---|---|
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) | |
15 | int status; | |
5623bdc2 KM |
16 | .fi |
17 | .SH DESCRIPTION | |
69ee3f0e KM |
18 | .I _exit |
19 | terminates a process with the following consequences: | |
20 | .in +5n | |
5623bdc2 | 21 | .PP |
69ee3f0e | 22 | All of the descriptors open in the calling process are closed. |
5623bdc2 | 23 | .PP |
69ee3f0e KM |
24 | If the parent process of the calling process is executing a |
25 | .I wait | |
26 | or is interested in the SIGCHLD signal, | |
27 | then it is notified of the calling process's termination and | |
28 | the low-order eight bits of \fIstatus\fP are made available to it; | |
29 | see | |
30 | .IR wait (2). | |
31 | .PP | |
32 | The parent process ID of all of the calling process's existing child | |
33 | processes are also set to 1. This means that the initialization process | |
34 | (see | |
35 | .IR intro (2)) | |
36 | inherits each of these processes as well. | |
37 | .in -5n | |
38 | .PP | |
39 | Most C programs call the library routine | |
40 | .IR exit (3) | |
41 | which performs cleanup actions in the standard i/o library before | |
42 | calling \fI_exit\fP\|. | |
43 | .SH "RETURN VALUE" | |
44 | This call never returns. | |
5623bdc2 | 45 | .SH "SEE ALSO" |
69ee3f0e | 46 | fork(2), wait(2), exit(3) |