stdcxx-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Farid Zaripov" <Farid_Zari...@epam.com>
Subject Exit code 3 on MSVC and ICC/Windows
Date Thu, 10 Apr 2008 16:53:04 GMT
  Below is a listing of the raise() function from MSVC CRT:
int __cdecl raise (
        int signum
        )
{
[...]
        /*

        * If the current action is SIG_IGN, just return

        */

        if ( sigact == SIG_IGN )

                return(0);

 

        /*

        * If the current action is SIG_DFL, take the default action

        */

        if ( sigact == SIG_DFL ) {

                /*

                * The current default action for all of the supported

                * signals is to terminate with an exit code of 3.

                */

                _exit(3);

        }

[...]
}
 
  And also the listing of the abort() :
 
void __cdecl abort (

        void

        )

{

        _PHNDLR sigabrt_act = SIG_DFL;

        if (__abort_behavior & _WRITE_ABORT_MSG)

        {

            /* write the abort message */

            _NMSG_WRITE(_RT_ABORT);

        }

 

        /* Check if the user installed a handler for SIGABRT.

        * We need to read the user handler atomically in the case

        * another thread is aborting while we change the signal

        * handler.

        */

        sigabrt_act = __get_sigabrt();

        if (sigabrt_act != SIG_DFL)

        {

            raise(SIGABRT);

        }

 

        /* If there is no user handler for SIGABRT or if the user

        * handler returns, then exit from the program anyway

        */

[...]

        /* If we don't want to call ReportFault, then we call _exit(3), which is the

        * same as invoking the default handler for SIGABRT

        */

 

        _exit(3);

}

Farid.
 
Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message