diff -r 000000000000 -r bde4ae8d615e os/ossrv/genericopenlibs/cstdlib/LPOSIX/ABORT.C --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/os/ossrv/genericopenlibs/cstdlib/LPOSIX/ABORT.C Fri Jun 15 03:10:57 2012 +0200 @@ -0,0 +1,69 @@ +/* +* Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* FUNCTION +* <>---abnormal termination of a program +* INDEX +* abort +* ANSI_SYNOPSIS +* #include +* void abort(void); +* TRAD_SYNOPSIS +* #include +* void abort(); +* Use <> to signal that your program has detected a condition it +* cannot deal with. Normally, <> ends your program's execution. +* Before terminating your program, <> raises the exception <> +* (using `<>'). If you have used <> to register +* an exception handler for this condition, that handler has the +* opportunity to retain control, thereby avoiding program termination. +* In this implementation, <> does not perform any stream- or +* file-related cleanup (the host environment may do so; if not, you can +* arrange for your program to do its own cleanup with a <> +* exception handler). +* RETURNS +* <> does not return to its caller. +* PORTABILITY +* ANSI C requires <>. +* Supporting OS subroutines required: <>, <>. +* +* +*/ + + + + +#include /* for definition of _exit() */ +/* #include */ + +EXPORT_C void +#ifdef EKA2 +do_abort (void) _ATTRIBUTE((noreturn)) // Export in place of 'abort()' on EKA2 for binary compatibility. +#else +abort (void) _ATTRIBUTE((noreturn)) +#endif +{ + for (;;) + { + /* raise (SIGABRT); */ + _exit (1); + } +} + +#if (defined (__ARMCC__) || defined (__X86GCC__)) +void abort (void) _ATTRIBUTE((noreturn)) + { + do_abort(); + } +#endif