cpython/Include/internal/pycore_signal.h

// Define Py_NSIG constant for signal handling.

#ifndef Py_INTERNAL_SIGNAL_H
#define Py_INTERNAL_SIGNAL_H
#ifdef __cplusplus
extern "C" {
#endif

#ifndef Py_BUILD_CORE
#  error "this header requires Py_BUILD_CORE define"
#endif

#include <signal.h>               // NSIG


// Restore signals that the interpreter has called SIG_IGN on to SIG_DFL.
// Export for '_posixsubprocess' shared extension.
PyAPI_FUNC(void) _Py_RestoreSignals(void);

#ifdef _SIG_MAXSIG
   // gh-91145: On FreeBSD, <signal.h> defines NSIG as 32: it doesn't include
   // realtime signals: [SIGRTMIN,SIGRTMAX]. Use _SIG_MAXSIG instead. For
   // example on x86-64 FreeBSD 13, SIGRTMAX is 126 and _SIG_MAXSIG is 128.
#define Py_NSIG
#elif defined(NSIG)
#define Py_NSIG
#elif defined(_NSIG)
#define Py_NSIG
#elif defined(_SIGMAX)
#define Py_NSIG
#elif defined(SIGMAX)
#define Py_NSIG
#else
#define Py_NSIG
#endif

#define INVALID_FD

struct _signals_runtime_state {};

#ifdef MS_WINDOWS
#define _signals_WAKEUP_INIT
#else
#define _signals_WAKEUP_INIT
#endif

#define _signals_RUNTIME_INIT


// Export for '_multiprocessing' shared extension
PyAPI_FUNC(int) _PyOS_IsMainThread(void);

#ifdef MS_WINDOWS
// <windows.h> is not included by Python.h so use void* instead of HANDLE.
// Export for '_multiprocessing' shared extension
PyAPI_FUNC(void*) _PyOS_SigintEvent(void);
#endif

#ifdef __cplusplus
}
#endif
#endif  // !Py_INTERNAL_SIGNAL_H