Where Online Learning is simpler!
The C and C++ Include Header Files
/usr/include/python3.12/internal/pycore_signal.h
$ cat -n /usr/include/python3.12/internal/pycore_signal.h 1 // Define Py_NSIG constant for signal handling. 2 3 #ifndef Py_INTERNAL_SIGNAL_H 4 #define Py_INTERNAL_SIGNAL_H 5 #ifdef __cplusplus 6 extern "C" { 7 #endif 8 9 #ifndef Py_BUILD_CORE 10 # error "this header requires Py_BUILD_CORE define" 11 #endif 12 13 #include "pycore_atomic.h" // _Py_atomic_address 14 15 #include
// NSIG 16 17 18 #ifdef _SIG_MAXSIG 19 // gh-91145: On FreeBSD,
defines NSIG as 32: it doesn't include 20 // realtime signals: [SIGRTMIN,SIGRTMAX]. Use _SIG_MAXSIG instead. For 21 // example on x86-64 FreeBSD 13, SIGRTMAX is 126 and _SIG_MAXSIG is 128. 22 # define Py_NSIG _SIG_MAXSIG 23 #elif defined(NSIG) 24 # define Py_NSIG NSIG 25 #elif defined(_NSIG) 26 # define Py_NSIG _NSIG // BSD/SysV 27 #elif defined(_SIGMAX) 28 # define Py_NSIG (_SIGMAX + 1) // QNX 29 #elif defined(SIGMAX) 30 # define Py_NSIG (SIGMAX + 1) // djgpp 31 #else 32 # define Py_NSIG 64 // Use a reasonable default value 33 #endif 34 35 #define INVALID_FD (-1) 36 37 struct _signals_runtime_state { 38 volatile struct { 39 _Py_atomic_int tripped; 40 /* func is atomic to ensure that PyErr_SetInterrupt is async-signal-safe 41 * (even though it would probably be otherwise, anyway). 42 */ 43 _Py_atomic_address func; 44 } handlers[Py_NSIG]; 45 46 volatile struct { 47 #ifdef MS_WINDOWS 48 /* This would be "SOCKET fd" if
were always included. 49 It isn't so we must cast to SOCKET where appropriate. */ 50 volatile int fd; 51 #elif defined(__VXWORKS__) 52 int fd; 53 #else 54 sig_atomic_t fd; 55 #endif 56 57 int warn_on_full_buffer; 58 #ifdef MS_WINDOWS 59 int use_send; 60 #endif 61 } wakeup; 62 63 /* Speed up sigcheck() when none tripped */ 64 _Py_atomic_int is_tripped; 65 66 /* These objects necessarily belong to the main interpreter. */ 67 PyObject *default_handler; 68 PyObject *ignore_handler; 69 70 #ifdef MS_WINDOWS 71 /* This would be "HANDLE sigint_event" if
were always included. 72 It isn't so we must cast to HANDLE everywhere "sigint_event" is used. */ 73 void *sigint_event; 74 #endif 75 76 /* True if the main interpreter thread exited due to an unhandled 77 * KeyboardInterrupt exception, suggesting the user pressed ^C. */ 78 int unhandled_keyboard_interrupt; 79 }; 80 81 #ifdef MS_WINDOWS 82 # define _signals_WAKEUP_INIT \ 83 {.fd = INVALID_FD, .warn_on_full_buffer = 1, .use_send = 0} 84 #else 85 # define _signals_WAKEUP_INIT \ 86 {.fd = INVALID_FD, .warn_on_full_buffer = 1} 87 #endif 88 89 #define _signals_RUNTIME_INIT \ 90 { \ 91 .wakeup = _signals_WAKEUP_INIT, \ 92 } 93 94 95 #ifdef __cplusplus 96 } 97 #endif 98 #endif // !Py_INTERNAL_SIGNAL_H
Contact us
|
About us
|
Term of use
|
Copyright © 2000-2025 MyWebUniversity.com ™