ReactOS 0.4.16-dev-2104-gb84fa49
signal.h File Reference
#include <corecrt.h>
Include dependency graph for signal.h:

Go to the source code of this file.

Macros

#define SIGINT   2
 
#define SIGILL   4
 
#define SIGFPE   8
 
#define SIGSEGV   11
 
#define SIGTERM   15
 
#define SIGBREAK   21
 
#define SIGABRT   22
 
#define NSIG   (SIGABRT + 1)
 
#define SIG_DFL   ((__sighandler_t)0)
 
#define SIG_IGN   ((__sighandler_t)1)
 
#define SIG_ERR   ((__sighandler_t)-1)
 

Typedefs

typedef void(__cdecl__sighandler_t) (int)
 

Functions

_ACRTIMP void **__cdecl __pxcptinfoptrs (void)
 
_ACRTIMP __sighandler_t __cdecl signal (int sig, __sighandler_t func)
 
_ACRTIMP int __cdecl raise (int sig)
 

Macro Definition Documentation

◆ NSIG

#define NSIG   (SIGABRT + 1)

Definition at line 33 of file signal.h.

◆ SIG_DFL

#define SIG_DFL   ((__sighandler_t)0)

Definition at line 41 of file signal.h.

◆ SIG_ERR

#define SIG_ERR   ((__sighandler_t)-1)

Definition at line 43 of file signal.h.

◆ SIG_IGN

#define SIG_IGN   ((__sighandler_t)1)

Definition at line 42 of file signal.h.

◆ SIGABRT

#define SIGABRT   22

Definition at line 31 of file signal.h.

◆ SIGBREAK

#define SIGBREAK   21

Definition at line 30 of file signal.h.

◆ SIGFPE

#define SIGFPE   8

Definition at line 27 of file signal.h.

◆ SIGILL

#define SIGILL   4

Definition at line 26 of file signal.h.

◆ SIGINT

#define SIGINT   2

Definition at line 25 of file signal.h.

◆ SIGSEGV

#define SIGSEGV   11

Definition at line 28 of file signal.h.

◆ SIGTERM

#define SIGTERM   15

Definition at line 29 of file signal.h.

Typedef Documentation

◆ __sighandler_t

typedef void(__cdecl * __sighandler_t) (int)

Definition at line 39 of file signal.h.

Function Documentation

◆ __pxcptinfoptrs()

_ACRTIMP void **__cdecl __pxcptinfoptrs ( void  )

Definition at line 528 of file except.c.

529{
530 return (void**)&msvcrt_get_thread_data()->xcptinfo;
531}
thread_data_t *CDECL msvcrt_get_thread_data(void)
Definition: thread.c:45

◆ raise()

_ACRTIMP int __cdecl raise ( int  sig)

Definition at line 682 of file except.c.

683{
685
686 TRACE("(%d)\n", sig);
687
688 switch (sig)
689 {
690 case SIGFPE:
691 case SIGILL:
692 case SIGSEGV:
693 handler = sighandlers[sig];
694 if (handler == SIG_DFL) _exit(3);
695 if (handler != SIG_IGN)
696 {
698
699 sighandlers[sig] = SIG_DFL;
700
701 old_ep = *ep;
702 *ep = NULL;
703 if (sig == SIGFPE)
705 else
706 handler(sig);
707 *ep = old_ep;
708 }
709 break;
710 case SIGABRT:
711 case SIGINT:
712 case SIGTERM:
713 case SIGBREAK:
714 handler = sighandlers[sig];
715 if (handler == SIG_DFL) _exit(3);
716 if (handler != SIG_IGN)
717 {
718 sighandlers[sig] = SIG_DFL;
719 handler(sig);
720 }
721 break;
722 default:
723 return -1;
724 }
725 return 0;
726}
#define NULL
Definition: types.h:112
UINT(* handler)(MSIPACKAGE *)
Definition: action.c:7512
static __sighandler_t sighandlers[NSIG]
Definition: except.c:48
void **CDECL __pxcptinfoptrs(void)
Definition: except.c:528
void(CDECL * float_handler)(int, int)
Definition: except.c:533
void CDECL _exit(int exitcode)
Definition: exit.c:187
#define _FPE_EXPLICITGEN
Definition: float.h:129
#define SIG_DFL
Definition: signal.h:41
#define SIGINT
Definition: signal.h:25
#define SIGILL
Definition: signal.h:26
#define SIGTERM
Definition: signal.h:29
void(__cdecl * __sighandler_t)(int)
Definition: signal.h:39
#define SIGFPE
Definition: signal.h:27
#define SIGABRT
Definition: signal.h:31
#define SIG_IGN
Definition: signal.h:42
#define SIGSEGV
Definition: signal.h:28
#define SIGBREAK
Definition: signal.h:30
#define TRACE(s)
Definition: solgame.cpp:4

◆ signal()

_ACRTIMP __sighandler_t __cdecl signal ( int  sig,
__sighandler_t  func 
)

Definition at line 650 of file except.c.

651{
653
654 TRACE("(%d, %p)\n", sig, func);
655
656 if (func == SIG_ERR) return SIG_ERR;
657
658 switch (sig)
659 {
660 /* Cases handled internally. Note SIGTERM is never generated by Windows,
661 * so we effectively mask it.
662 */
663 case SIGABRT:
664 case SIGFPE:
665 case SIGILL:
666 case SIGSEGV:
667 case SIGINT:
668 case SIGTERM:
669 case SIGBREAK:
670 ret = sighandlers[sig];
671 sighandlers[sig] = func;
672 break;
673 default:
674 ret = SIG_ERR;
675 }
676 return ret;
677}
#define SIG_ERR
Definition: signal.h:43
return ret
Definition: mutex.c:146
GLenum func
Definition: glext.h:6028