ReactOS  0.4.13-dev-563-g0561610
main.c
Go to the documentation of this file.
1 #define _sio_main_c_
2 #include "syshdrs.h"
3 
5 
6 #ifndef NO_SIGNALS
7 
8 volatile Sjmp_buf gNetTimeoutJmp;
9 volatile Sjmp_buf gPipeJmp;
10 
11 void
12 SIOHandler(int sigNum)
13 {
14  if (sigNum == SIGPIPE)
15  SLongjmp(gPipeJmp, 1);
16  SLongjmp(gNetTimeoutJmp, 1);
17 } /* SIOHandler */
18 
19 
20 
21 
22 void (*SSignal(int signum, void (*handler)(int)))(int)
23 {
24 #ifdef HAVE_SIGACTION
25  struct sigaction sa, osa;
26 
27  (void) sigemptyset(&sa.sa_mask);
28  sa.sa_flags = 0;
29  sa.sa_handler = handler;
30  if (signum == SIGALRM) {
31 #ifdef SA_INTERRUPT
32  sa.sa_flags |= SA_INTERRUPT;
33 #endif
34  } else {
35 #ifdef SA_RESTART
36  sa.sa_flags |= SA_RESTART;
37 #endif
38  }
39  if (sigaction(signum, &sa, &osa) < 0)
40  return (SIG_ERR);
41  return (osa.sa_handler);
42 #else
43  return SSignal(signum, handler);
44 #endif /* HAVE_SIGACTION */
45 }
46 
47 #endif /* NO_SIGNALS */
48 
49 /* eof main.c */
struct png_info_def **typedef void(__cdecl typeof(png_destroy_read_struct))(struct png_struct_def **
Definition: typeof.h:49
#define SIG_ERR
Definition: signal.h:52
#define Sjmp_buf
Definition: sio.h:41
#define SLongjmp(a, b)
Definition: sio.h:40
#define SIGPIPE
Definition: signal.h:35
void(*)(int) SSignal(int signum, void(*handler)(int))
Definition: sio.h:237
UINT(* handler)(MSIPACKAGE *)
Definition: action.c:7786
static struct sockaddr_in sa
Definition: adnsresfilter.c:69
int gLibSio_Uses_Me_To_Quiet_Variable_Unused_Warnings
Definition: main.c:4
void SIOHandler(int)
unsigned int(__cdecl typeof(jpeg_read_scanlines))(struct jpeg_decompress_struct *
Definition: typeof.h:31