Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ on_exit(3) — OS/MP 4.1C

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

gprof(1)

tcov(1)

exit(3)

ON_EXIT(3)  —  C LIBRARY FUNCTIONS

NAME

on_exit − name termination handler

SYNOPSIS

int on_exit(procp, arg)
void (∗procp)();
caddr_t arg;

DESCRIPTION

on_exit() names a routine to be called after a program calls exit(3) or returns normally, and before its process terminates.  The routine named is called as

(∗procp)(status, arg);

where status is the argument with which exit() was called, or zero if main returns.  Typically, arg is the address of an argument vector to (∗procp), but may be an integer value.  Several calls may be made to on_exit, specifying several termination handlers.  The order in which they are called is the reverse of that in which they were given to on_exit. 

SEE ALSO

gprof(1), tcov(1), exit(3)

DIAGNOSTICS

on_exit() returns zero normally, or nonzero if the procedure name could not be stored. 

NOTES

This call is specific to the OS/MP and SunOS operating systems and should not be used if portability is a concern. 

Standard I/O exit processing is always done last. 

Solbourne Computer, Inc.  —  13 Dec 1990

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026