From 78e51a8c6678b6e3dff3d619aa786669f531f4bc Mon Sep 17 00:00:00 2001 From: rsc Date: Fri, 14 Jan 2005 03:45:44 +0000 Subject: checkpoint --- man/man3/exits.html | 126 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 126 insertions(+) create mode 100644 man/man3/exits.html (limited to 'man/man3/exits.html') diff --git a/man/man3/exits.html b/man/man3/exits.html new file mode 100644 index 00000000..cc94a468 --- /dev/null +++ b/man/man3/exits.html @@ -0,0 +1,126 @@ + +exits(3) - Plan 9 from User Space + + + + +
+
+
EXITS(3)EXITS(3) +
+
+

NAME
+ +
+ + exits, _exits, atexit, atexitdont, terminate – terminate process, + process cleanup
+ +
+

SYNOPSIS
+ +
+ + #include <u.h>
+ #include <libc.h> +
+
+ void _exits(char *msg)
+ void exits(char *msg)
+ +
+
+ int    atexit(void(*)(void))
+ +
+
+ void atexitdont(void(*)(void))
+
+
+

DESCRIPTION
+ +
+ + Exits is the conventional way to terminate a process. _Exits also + terminates a process but does not call the registered atexit handlers + (q.v.). They can never return. +
+ + Msg conventionally includes a brief (maximum length ERRLEN) explanation + of the reason for exiting, or a null pointer or empty string to + indicate normal termination. The string is passed to the parent + process, prefixed by the name and process id of the exiting process, + when the parent does a wait(3). +
+ + Before calling _exits with msg as an argument, exits calls in + reverse order all the functions recorded by atexit. +
+ + Atexit records fn as a function to be called by exits. It returns + zero if it failed, nonzero otherwise. A typical use is to register + a cleanup routine for an I/O package. To simplify programs that + fork or share memory, exits only calls those atexit-registered + functions that were registered by the same process as that calling + exits. +
+ + Calling atexit twice (or more) with the same function argument + causes exits to invoke the function twice (or more). +
+ + There is a limit to the number of exit functions that will be + recorded; atexit returns 0 if that limit has been reached. +
+ + Atexitdont cancels a previous registration of an exit function.
+ +
+

SOURCE
+ +
+ + /usr/local/plan9/src/lib9/atexit.c
+ /usr/local/plan9/src/lib9/_exits.c
+
+
+

SEE ALSO
+ +
+ + fork(2), wait(3)
+ +
+

BUGS
+ +
+ + Because of limitations of Unix, the exit status of a process can + only be an 8-bit integer. Exit status 0 is used for empty exit + messages, and 1 for non-empty messages. +
+ + Exit codes 97 through 99 are used by the thread library to signal + internal synchronization errors between the main program and a + proxy process that implements backgrounding. +
+ + To avoid name conflicts with the underlying system, atexit and + atexitdont are preprocessor macros defined as p9atexit and p9atexitdont; + see intro(3).
+ +
+ +

+
+
+ + +
+
+
+Space Glenda +
+
+ + -- cgit v1.2.3