-
Notifications
You must be signed in to change notification settings - Fork 2
/
exit.3
39 lines (38 loc) · 909 Bytes
/
exit.3
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
.\" Copyright (c) 1983 Regents of the University of California.
.\" All rights reserved. The Berkeley software License Agreement
.\" specifies the terms and conditions for redistribution.
.\"
.\" @(#)exit.3 6.2 (Berkeley) 5/12/86
.\"
.TH EXIT 3 "May 12, 1986"
.UC 5
.SH NAME
exit, atexit \- terminate a process after flushing any pending output
.SH SYNOPSIS
.nf
.ft B
#include <stdlib.h>
void exit(int \fIstatus\fP)
int atexit(void (*\fIfunc\fP)(void))
.ft R
.fi
.SH DESCRIPTION
.B Exit
first calls all functions registered by
.BR atexit ,
flushes all data buffered by the Standard I/O library, and finally
terminates the process.
.B Exit
never returns.
.PP
.B Atexit
registers the function
.I func
into a table of functions to be called on exit.
.SH "SEE ALSO"
.BR exit (2).
.SH DIAGNOSTICS
.B Atexit
returns 0 on success, \-1 if
.B malloc
cannot allocate more memory for the list of registered functions.