msvcrt: Implemented the raise function.

This commit is contained in:
Eric Pouech 2007-02-08 21:33:39 +01:00 committed by Alexandre Julliard
parent 9f309b32e6
commit bb5a20c61a
2 changed files with 35 additions and 1 deletions

View File

@ -543,6 +543,40 @@ MSVCRT___sighandler_t CDECL MSVCRT_signal(int sig, MSVCRT___sighandler_t func)
return ret;
}
/*********************************************************************
* raise (MSVCRT.@)
*/
int CDECL MSVCRT_raise(int sig)
{
MSVCRT___sighandler_t handler;
TRACE("(%d)\n", sig);
switch (sig)
{
case MSVCRT_SIGABRT:
case MSVCRT_SIGFPE:
case MSVCRT_SIGILL:
case MSVCRT_SIGSEGV:
case MSVCRT_SIGINT:
case MSVCRT_SIGTERM:
handler = sighandlers[sig];
if (handler == MSVCRT_SIG_DFL) MSVCRT__exit(3);
if (handler != MSVCRT_SIG_IGN)
{
sighandlers[sig] = MSVCRT_SIG_DFL;
if (sig == MSVCRT_SIGFPE)
((float_handler)handler)(sig, _FPE_EXPLICITGEN);
else
handler(sig);
}
break;
default:
return -1;
}
return 0;
}
/*********************************************************************
* _XcptFilter (MSVCRT.@)
*/

View File

@ -686,7 +686,7 @@
@ cdecl putwc(long ptr) MSVCRT_fputwc
@ cdecl putwchar(long) _fputwchar
@ cdecl qsort(ptr long long ptr) ntdll.qsort
@ stub raise #(long)
@ cdecl raise(long) MSVCRT_raise
@ cdecl rand() MSVCRT_rand
@ cdecl realloc(ptr long) MSVCRT_realloc
@ cdecl remove(str) MSVCRT_remove