Guardian C Library Calls Reference Manual
Reference to Library Calls
Guardian TNS C Library Calls Reference Manual—128833 3-31
exit
exit
The exit function writes to open files any data left in the buffers, closes files, and
terminates execution of your C program.
status
specifies the termination alternatives:
•
If the status value is zero, the compiler translates it to EXIT_SUCCESS which
indicates normal termination.
•
If the status value is less than zero, the compiler translates it to EXIT_FAILURE
which indicates abnormal termination.
•
If the status value is greater than zero, the compiler equates a completion code to
status.
Return Value
none; exit does not return to its caller.
Usage Guidelines
•
When you use EXIT_FAILURE, your program terminates with a completion code
of 5. When you use EXIT_SUCCESS, it terminates with a completion code of 0.
•
A completion code of 5 indicates abnormal, voluntary, but premature termination
with FATAL errors or diagnostics. For example, if the process is a compiler, the
compilation terminated with FATAL diagnostics, with an incomplete object file
being built and an incomplete listing generated (the compiler quit compiling
prematurely).
•
A completion code of 0 indicates normal, voluntary termination with no errors.
•
For active backup process pairs, if the primary process calls exit and specifies
normal termination (the status value is zero), both the primary and backup processes
terminate.
•
For more information regarding completion codes, refer to the Guardian Procedure
Calls Reference Manual.
#include <stdlibh>
void exit(int status);