Modula-2 || Compiler & Tools || Library || Search Engine


Ulm's Modula-2 Library:
SysExit


NAME

SysExit - terminate process

SYNOPSIS

PROCEDURE Exit(errorCode: CARDINAL);


PROCEDURE EnterCleanup(p: PROC);

DESCRIPTION

The call of Exit causes the process to terminate with exit code errorCode. An errorCode of 0 indicates success. All other codes are interpreted as failure by command shells. EnterCleanup causes p to be called on exiting. Multiple calls of EnterCleanup are possible. In this case Exit calls the cleanup procedures in reverse order (LIFO). Recursive calls of Exit (by cleanup procedures) cause Exit to exit immediately.

On return of the main module body, Exit is called with errorCode 0. Exit is not called on run time error aborts.

SEE ALSO

exit(2), sh(1)

BUGS

The number of cleanup procedures is limited.
Edited by: borchert, last change: 1997/02/25, revision: 1.2, converted to HTML: 1997/04/28

Modula-2 || Compiler & Tools || Library || Search Engine