ReactOS 0.4.16-dev-258-g81860b4
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 6 of file xcptinfo.c.

7{
8 return (void**)&msvcrt_get_thread_data()->xcptinfo;
9}
thread_data_t * msvcrt_get_thread_data(void)
Definition: tls.c:31

Referenced by sighandler(), and test___pxcptinfoptrs().

◆ raise()

int __cdecl raise ( int  _SigNum)

Definition at line 71 of file signal.c.

72{
74 unsigned int i;
75
76 switch (sig)
77 {
78 case SIGINT:
79 case SIGILL:
80 case SIGFPE:
81 case SIGSEGV:
82 case SIGTERM:
83 case SIGBREAK:
84 case SIGABRT:
85 break;
86
87 default:
88 //FIXME: set last err?
89 return -1;
90 }
91
92
93 // if(sig <= 0)
94 // return -1;
95 // if(sig > SIGMAX)
96 // return -1;
97
98 for(i=0;i<sizeof(signal_list)/sizeof(signal_list[0]);i++)
99 {
100 if ( signal_list[i].signal == sig )
101 {
103 break;
104 }
105 }
106
107 if(temp == SIG_IGN)// || (sig == SIGQUIT && temp == (_p_sig_fn_t)SIG_DFL))
108 return 0; /* Ignore it */
109
110 if(temp == SIG_DFL)
111 _default_handler(sig); /* this does not return */
112 else
113 temp(sig);
114
115 return 0;
116}
#define SIG_DFL
Definition: signal.h:47
#define SIGINT
Definition: signal.h:23
#define SIGILL
Definition: signal.h:25
void(* __p_sig_fn_t)(int)
Definition: signal.h:45
#define SIGTERM
Definition: signal.h:39
#define SIGFPE
Definition: signal.h:30
#define SIGABRT
Definition: signal.h:28
#define SIG_IGN
Definition: signal.h:48
#define SIGSEGV
Definition: signal.h:33
#define SIGBREAK
Definition: signal.h:40
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
static sig_element signal_list[]
Definition: signal.c:4
void _default_handler(int sig)
Definition: signal.c:120
int signal
Definition: except.c:82
__p_sig_fn_t handler
Definition: msvcrt.h:148

Referenced by _CrtHandleDbgReport(), abort(), 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}
#define EINVAL
Definition: acclib.h:90
#define SIG_ERR
Definition: signal.h:52
GLenum func
Definition: glext.h:6028
unsigned int uintptr_t
Definition: intrin.h:47
errno_t __cdecl _set_errno(_In_ int _Value)