Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Watcom C/C++ v10.0 : C library - <b>synopsis:</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
Synopsis:
    #include <stdlib.h>
    void _exit( int status );

Description:
    The _exit function causes normal program termination to occur.

     1. The functions registered by the  atexit or  onexit functions are not
        called.

     2. Any unopened files are not closed and any buffered output is not
        flushed to the associated files or devices.

     3. Any files created by  tmpfile are not removed.

     4. The return status is made available to the parent process.  Only the
        low order byte of status is available on DOS systems.  The status
        value is typically set to 0 to indicate successful termination and
        set to some other value to indicate an error.


Returns:
    The _exit function does not return to its caller.

See Also:
    abort, atexit, _bgetcmd, exec Functions Functions, exit, getcmd, getenv, main,
    onexit, putenv, spawn Functions Functions, system

Example:
    #include <stdio.h>
    #include <stdlib.h>

    void main( int argc, char *argv[] )
      {
        FILE *fp;

        if( argc <= 1 ) {
          fprintf( stderr, "Missing argument\n" );
          exit( EXIT_FAILURE );
        }
        fp = fopen( argv[1], "r" );
        if( fp == NULL ) {
          fprintf( stderr, "Unable to open '%s'\n", argv[1] );
          _exit( EXIT_FAILURE );
        }
        fclose( fp );
        _exit( EXIT_SUCCESS );
      }

Classification:
    POSIX 1003.1

Systems:
    All

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson