_exit() Terminate Process without Cleanup
#include <process.h>
#include <stdlib.h>
void _exit(status);
int status; Exit status
_exit() terminates the calling process and returns the low-byte of
'status' (status & 0xFF) to the waiting parent process, if one
exists. Functions registered with ONEXIT are NOT executed, and
stream buffers are not flushed.
Returns: There is no return value; exit() does not return to the
calling process. 'status' is returned to the parent
process. (The parent process is usually the operating
system.)
Notes: exit() has a similar function as _exit(), but exit() does
flush stream buffers and execute functions registered
with onexit() before terminating.
-------------------------------- Example ---------------------------------
The following statements set the exit status to 1 if more than one
command line argument is passed.
#include <stdio.h> /* for 'printf' */
#include <stdlib.h> /* for '_exit' (also in <process.h>) */
main(argc, argv)
int argc;
char *argv[];
{
if (argc > 2) {
perror("no more than 1 command line parameter allowed\n");
_exit(1); /* exit immediately */
}
/* exit normally here with a status of 0 */
}
Seealso:
This page last updated on Fri Nov 30 10:48:32 MSK 2001
Copyright © 1992-2001, Vitaly Filatov, Moscow, Russia
Webmaster