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