ReactOS 0.4.16-dev-2332-g4cba65d
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 529 of file except.c.

530{
531 return (void**)&msvcrt_get_thread_data()->xcptinfo;
532}
thread_data_t *CDECL msvcrt_get_thread_data(void)
Definition: ucrt_tls_sup.c:59

◆ raise()

int __cdecl raise ( int  _SigNum)

Definition at line 685 of file except.c.

686{
688
689 TRACE("(%d)\n", sig);
690
691 switch (sig)
692 {
693 case SIGFPE:
694 case SIGILL:
695 case SIGSEGV:
696 handler = sighandlers[sig];
697 if (handler == SIG_DFL) _exit(3);
698 if (handler != SIG_IGN)
699 {
701
702 sighandlers[sig] = SIG_DFL;
703
704 old_ep = *ep;
705 *ep = NULL;
706 if (sig == SIGFPE)
708 else
709 handler(sig);
710 *ep = old_ep;
711 }
712 break;
713 case SIGABRT:
714 case SIGINT:
715 case SIGTERM:
716 case SIGBREAK:
717 handler = sighandlers[sig];
718 if (handler == SIG_DFL) _exit(3);
719 if (handler != SIG_IGN)
720 {
721 sighandlers[sig] = SIG_DFL;
722 handler(sig);
723 }
724 break;
725 default:
726 return -1;
727 }
728 return 0;
729}
#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:529
void(CDECL * float_handler)(int, int)
Definition: except.c:535
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 
)