add exticode
This commit is contained in:
parent
a79e8ab44d
commit
3449b18918
1 changed files with 17 additions and 3 deletions
|
|
@ -1,6 +1,6 @@
|
||||||
.TH EXITS 3
|
.TH EXITS 3
|
||||||
.SH NAME
|
.SH NAME
|
||||||
exits, _exits, atexit, atexitdont, terminate \- terminate process, process cleanup
|
exits, _exits, exitcode, atexit, atexitdont \- terminate process, process cleanup
|
||||||
.SH SYNOPSIS
|
.SH SYNOPSIS
|
||||||
.B #include <u.h>
|
.B #include <u.h>
|
||||||
.br
|
.br
|
||||||
|
|
@ -13,6 +13,9 @@ void _exits(char *msg)
|
||||||
void exits(char *msg)
|
void exits(char *msg)
|
||||||
.PP
|
.PP
|
||||||
.B
|
.B
|
||||||
|
int exitcode(char *msg)
|
||||||
|
.PP
|
||||||
|
.B
|
||||||
int atexit(void(*)(void))
|
int atexit(void(*)(void))
|
||||||
.PP
|
.PP
|
||||||
.B
|
.B
|
||||||
|
|
@ -87,8 +90,19 @@ cancels a previous registration of an exit function.
|
||||||
.SH BUGS
|
.SH BUGS
|
||||||
Because of limitations of Unix, the exit status of a
|
Because of limitations of Unix, the exit status of a
|
||||||
process can only be an 8-bit integer.
|
process can only be an 8-bit integer.
|
||||||
Exit status 0 is used for empty exit messages, and 1 for
|
.I Exits
|
||||||
non-empty messages.
|
and
|
||||||
|
.I _exits
|
||||||
|
treat null or empty exit status as exit code 0
|
||||||
|
and call
|
||||||
|
.I exitcode
|
||||||
|
to translate any other string into an exit code.
|
||||||
|
By default, the library provides an
|
||||||
|
.I exitcode
|
||||||
|
that maps all messages to 1.
|
||||||
|
Applications may find it useful to provide their own
|
||||||
|
implementations of
|
||||||
|
.I exitcode .
|
||||||
.PP
|
.PP
|
||||||
Exit codes 97 through 99 are used by the thread library to signal
|
Exit codes 97 through 99 are used by the thread library to signal
|
||||||
internal synchronization errors between the main program
|
internal synchronization errors between the main program
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue