exits man page on Plan9

Man page or keyword search:  
man Server   549 pages
apropos Keyword Search (all sections)
Output format
Plan9 logo
[printable version]

EXITS(2)							      EXITS(2)

       exits,  _exits,	atexit,	 atexitdont,  terminate	 -  terminate process,
       process cleanup

       #include <u.h>
       #include <libc.h>

       void _exits(char *msg)
       void exits(char *msg)

       int  atexit(void(*)(void))

       void atexitdont(void(*)(void))

       Exits is the conventional way to terminate a process.   _Exits  is  the
       underlying system call.	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	 indi‐
       cate  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(2).

       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.


       fork(2), wait(2)

                             _         _         _ 
                            | |       | |       | |     
                            | |       | |       | |     
                         __ | | __ __ | | __ __ | | __  
                         \ \| |/ / \ \| |/ / \ \| |/ /  
                          \ \ / /   \ \ / /   \ \ / /   
                           \   /     \   /     \   /    
                            \_/       \_/       \_/ 
More information is available in HTML format for server Plan9

List of man pages available for Plan9

Copyright (c) for man pages and the logo by the respective OS vendor.

For those who want to learn more, the polarhome community provides shell access and support.

[legal] [privacy] [GNU] [policy] [cookies] [netiquette] [sponsors] [FAQ]
Polarhome, production since 1999.
Member of Polarhome portal.
Based on Fawad Halim's script.
Vote for polarhome
Free Shell Accounts :: the biggest list on the net