Subversion Repositories Kolibri OS

Rev

Blame | Last modification | View Log | Download | RSS feed

  1. /****************************************************************************
  2. *
  3. *                            Open Watcom Project
  4. *
  5. *    Portions Copyright (c) 1983-2002 Sybase, Inc. All Rights Reserved.
  6. *
  7. *  ========================================================================
  8. *
  9. *    This file contains Original Code and/or Modifications of Original
  10. *    Code as defined in and that are subject to the Sybase Open Watcom
  11. *    Public License version 1.0 (the 'License'). You may not use this file
  12. *    except in compliance with the License. BY USING THIS FILE YOU AGREE TO
  13. *    ALL TERMS AND CONDITIONS OF THE LICENSE. A copy of the License is
  14. *    provided with the Original Code and Modifications, and is also
  15. *    available at www.sybase.com/developer/opensource.
  16. *
  17. *    The Original Code and all software distributed under the License are
  18. *    distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
  19. *    EXPRESS OR IMPLIED, AND SYBASE AND ALL CONTRIBUTORS HEREBY DISCLAIM
  20. *    ALL SUCH WARRANTIES, INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF
  21. *    MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR
  22. *    NON-INFRINGEMENT. Please see the License for the specific language
  23. *    governing rights and limitations under the License.
  24. *
  25. *  ========================================================================
  26. *
  27. * Description:  Implementation of exit() and associated functions.
  28. *
  29. ****************************************************************************/
  30.  
  31.  
  32. #include "variety.h"
  33. #include "rtdata.h"
  34. #include "exitwmsg.h"
  35. #include "initfini.h"
  36. #include "rtinit.h"
  37. #include <stdio.h>
  38. #include <stdlib.h>
  39. //#include "defwin.h"
  40. #include "widechar.h"
  41. #include "initarg.h"
  42.  
  43. /*
  44.   __int23_exit is used by OS/2 as a general termination routine which unhooks
  45.   exception handlers.  A better name for this variable is __sig_exit.
  46.   __sig_exit should be the system dependent signal termination routine and
  47.   should replace the calls to __int23_exit and __FPE_handler_exit.
  48.   Each OS should define its own __sig_exit and do the appropriate thing (for
  49.   example, DOS version would call __int23_exit and __FPE_handler_exit)
  50. */
  51.  
  52.  
  53. #if defined(__NT__) || defined(__WARP__)
  54. _WCRTLINK extern void (*__process_fini)( unsigned, unsigned );
  55. #endif
  56.  
  57.  
  58. #if !defined(__UNIX__) && !defined(__WINDOWS_386__)
  59. static void _null_exit_rtn() {}
  60. void    (*__FPE_handler_exit)() = _null_exit_rtn;
  61. #endif
  62.  
  63. _WCRTLINK void exit( int status )
  64. {
  65.  
  66. #if defined(__UNIX__)
  67. #elif defined(__WINDOWS_386__)
  68. #elif defined(__NT__) || defined(__WARP__)
  69.     __FiniRtns( FINI_PRIORITY_EXIT, 255 );
  70. #else
  71.     __FiniRtns( FINI_PRIORITY_EXIT, 255 );
  72. #endif
  73.     _exit( status );
  74. }
  75.  
  76.  
  77. #ifndef __NETWARE__
  78.  
  79. _WCRTLINK void _exit( int status )
  80. {
  81.     __exit( status );
  82. }
  83.  
  84. #endif
  85.