#include <stdlib.h>
void
abort
( void
);
The abort function causes abnormal termination to occur unless the signal SIGABRT is being caught and the signal handler does not return. Whether open output streams are flushed or open streams are closed or temporary files removed is implementation-defined. An implementation-defined form of the status unsuccessful termination is returned to the host environment by means of the function call raise(SIGABRT).
The abort function cannot return to its caller.
The abort function calls raise(SIGABRT) and does not return.
#include <stdlib.h>
void
atexit
(void (*func)(void) );
The atexit function registers the function pointed to by func, to be called without arguments at normal program termination.
The implementation shall support the registration of at least 32 functions.
The atexit function returns zero if the registration succeeds, nonzero if it fails.
The XGC library supports 32 registrations.
#include <stdlib.h>
void
exit
(int status
);
The exit function causes normal program termination to occur. If more than one call to the exit function is executed by a program, the behavior is undefined.
First, all functions registered by the atexit function are called, in the reverse order of their registration.
Next, all open streams with unwritten buffered data are flushed, all open streams are closed, and all files created by the tmpfile function are removed.
Finally, control is returned to the host environment. If the value of status is zero or EXIT_SUCCESS, an implementation-defined form of the status successful termination is returned. If the value of status is EXIT_FAILURE, and implementation-defined form of the status unsuccessful termination is returned. Otherwise the status returned is implementation-defined.
The exit function cannot return to its caller.
The host environment consists of the file crt0, which initializes the stack then calls the main program. On return from the main program, the environment restarts and runs the main program again.
The XGC library does not support buffered streams or temporary files.
#include <stdlib.h>
int
system
(const char *
string );
The system function passes the string pointed to by string to the host environment to be executed by a command processor in an implementation-defined manner. A null pointer may be used for string to inquire whether a command processor exists.
If the argument is a null pointer, the system function returns nonzero only if a command processor is available. If the argument is not a null pointer, the system function returns an implementation-defined value.
There is no command processor.
If the argument is a null pointer, then zero is returned to indicate that a command processor is not available.
If the argument is not a null pointer, the system function returns -1, and errno is set to ENOSYS.