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 _SIG_ATOMIC_T_DEFINED
 
#define NSIG   23
 
#define SIGHUP   1 /* hangup */
 
#define SIGINT   2
 
#define SIGQUIT   3 /* quit */
 
#define SIGILL   4
 
#define SIGTRAP   5 /* trace trap (not reset when caught) */
 
#define SIGIOT   6 /* IOT instruction */
 
#define SIGABRT   6 /* used by abort, replace SIGIOT in the future */
 
#define SIGEMT   7 /* EMT instruction */
 
#define SIGFPE   8
 
#define SIGKILL   9 /* kill (cannot be caught or ignored) */
 
#define SIGBUS   10 /* bus error */
 
#define SIGSEGV   11
 
#define SIGSYS   12 /* bad argument to system call */
 
#define SIGPIPE   13 /* write on a pipe with no one to read it */
 
#define SIGTERM   15
 
#define SIGBREAK   21
 
#define SIGABRT2   22
 
#define SIGABRT_COMPAT   6
 
#define SIG_DFL   (__p_sig_fn_t)0
 
#define SIG_IGN   (__p_sig_fn_t)1
 
#define SIG_GET   (__p_sig_fn_t)2
 
#define SIG_SGE   (__p_sig_fn_t)3
 
#define SIG_ACK   (__p_sig_fn_t)4
 
#define SIG_ERR   (__p_sig_fn_t)-1
 
#define _pxcptinfoptrs   (*__pxcptinfoptrs())
 

Typedefs

typedef int sig_atomic_t
 
typedef void(* __p_sig_fn_t) (int)
 

Functions

void **__cdecl __pxcptinfoptrs (void)
 
__p_sig_fn_t __cdecl signal (int _SigNum, __p_sig_fn_t _Func)
 
int __cdecl raise (int _SigNum)
 

Macro Definition Documentation

◆ _pxcptinfoptrs

#define _pxcptinfoptrs   (*__pxcptinfoptrs())

Definition at line 55 of file signal.h.

◆ _SIG_ATOMIC_T_DEFINED

#define _SIG_ATOMIC_T_DEFINED

This file has no copyright assigned and is placed in the Public Domain. This file is part of the w64 mingw-runtime package. No warranty is given; refer to the file DISCLAIMER within this package.

Definition at line 16 of file signal.h.

◆ NSIG

#define NSIG   23

Definition at line 20 of file signal.h.

◆ SIG_ACK

#define SIG_ACK   (__p_sig_fn_t)4

Definition at line 51 of file signal.h.

◆ SIG_DFL

#define SIG_DFL   (__p_sig_fn_t)0

Definition at line 47 of file signal.h.

◆ SIG_ERR

#define SIG_ERR   (__p_sig_fn_t)-1

Definition at line 52 of file signal.h.

◆ SIG_GET

#define SIG_GET   (__p_sig_fn_t)2

Definition at line 49 of file signal.h.

◆ SIG_IGN

#define SIG_IGN   (__p_sig_fn_t)1

Definition at line 48 of file signal.h.

◆ SIG_SGE

#define SIG_SGE   (__p_sig_fn_t)3

Definition at line 50 of file signal.h.

◆ SIGABRT

#define SIGABRT   6 /* used by abort, replace SIGIOT in the future */

Definition at line 28 of file signal.h.

◆ SIGABRT2

#define SIGABRT2   22

Definition at line 41 of file signal.h.

◆ SIGABRT_COMPAT

#define SIGABRT_COMPAT   6

Definition at line 43 of file signal.h.

◆ SIGBREAK

#define SIGBREAK   21

Definition at line 40 of file signal.h.

◆ SIGBUS

#define SIGBUS   10 /* bus error */

Definition at line 32 of file signal.h.

◆ SIGEMT

#define SIGEMT   7 /* EMT instruction */

Definition at line 29 of file signal.h.

◆ SIGFPE

#define SIGFPE   8

Definition at line 30 of file signal.h.

◆ SIGHUP

#define SIGHUP   1 /* hangup */

Definition at line 22 of file signal.h.

◆ SIGILL

#define SIGILL   4

Definition at line 25 of file signal.h.

◆ SIGINT

#define SIGINT   2

Definition at line 23 of file signal.h.

◆ SIGIOT

#define SIGIOT   6 /* IOT instruction */

Definition at line 27 of file signal.h.

◆ SIGKILL

#define SIGKILL   9 /* kill (cannot be caught or ignored) */

Definition at line 31 of file signal.h.

◆ SIGPIPE

#define SIGPIPE   13 /* write on a pipe with no one to read it */

Definition at line 35 of file signal.h.

◆ SIGQUIT

#define SIGQUIT   3 /* quit */

Definition at line 24 of file signal.h.

◆ SIGSEGV

#define SIGSEGV   11

Definition at line 33 of file signal.h.

◆ SIGSYS

#define SIGSYS   12 /* bad argument to system call */

Definition at line 34 of file signal.h.

◆ SIGTERM

#define SIGTERM   15

Definition at line 39 of file signal.h.

◆ SIGTRAP

#define SIGTRAP   5 /* trace trap (not reset when caught) */

Definition at line 26 of file signal.h.

Typedef Documentation

◆ __p_sig_fn_t

typedef void(* __p_sig_fn_t) (int)

Definition at line 45 of file signal.h.

◆ sig_atomic_t

typedef int sig_atomic_t

Definition at line 17 of file signal.h.

Function Documentation

◆ __pxcptinfoptrs()

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()

int __cdecl raise ( int  _SigNum)

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

Referenced by _CrtHandleDbgReport(), _wassert(), abort(), common_assert_to_message_box(), common_message_window(), getline(), test___pxcptinfoptrs(), and test_signal().

◆ signal()

__p_sig_fn_t __cdecl signal ( int  _SigNum,
__p_sig_fn_t  _Func 
)

Definition at line 23 of file signal.c.

24{
26 unsigned int i;
27
28 switch (sig)
29 {
30 case SIGINT:
31 case SIGILL:
32 case SIGFPE:
33 case SIGSEGV:
34 case SIGTERM:
35 case SIGBREAK:
36 case SIGABRT:
37 break;
38
39 default:
41 return SIG_ERR;
42 }
43
44 // check with IsBadCodePtr
45 if ( (uintptr_t)func < 4096 && func != SIG_DFL && func != SIG_IGN)
46 {
48 return SIG_ERR;
49 }
50
51 for(i=0; i < sizeof(signal_list)/sizeof(signal_list[0]); i++)
52 {
53 if ( signal_list[i].signal == sig )
54 {
57 return temp;
58 }
59 }
60
61 /* should be impossible to get here */
63 return SIG_ERR;
64}
int CDECL _set_errno(int value)
Definition: errno.c:255
int signal
Definition: except.c:539
unsigned int uintptr_t
Definition: corecrt.h:185
#define EINVAL
Definition: errno.h:44
#define SIG_ERR
Definition: signal.h:43
GLenum func
Definition: glext.h:6028
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
static calc_node_t temp
Definition: rpn_ieee.c:38
void(* __p_sig_fn_t)(int)
Definition: signal.h:45
static sig_element signal_list[]
Definition: signal.c:4
__p_sig_fn_t handler
Definition: msvcrt.h:148