ReactOS 0.4.15-dev-7931-gfd331f1
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
8volatile Sjmp_buf gNetTimeoutJmp;
9volatile Sjmp_buf gPipeJmp;
10
11void
12SIOHandler(int sigNum)
13{
14 if (sigNum == SIGPIPE)
15 SLongjmp(gPipeJmp, 1);
16 SLongjmp(gNetTimeoutJmp, 1);
17} /* SIOHandler */
18
19
20
21
22void (*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 */
static struct sockaddr_in sa
Definition: adnsresfilter.c:69
#define SIG_ERR
Definition: signal.h:52
#define SIGPIPE
Definition: signal.h:35
UINT(* handler)(MSIPACKAGE *)
Definition: action.c:7482
unsigned int(__cdecl typeof(jpeg_read_scanlines))(struct jpeg_decompress_struct *
Definition: typeof.h:31
int gLibSio_Uses_Me_To_Quiet_Variable_Unused_Warnings
Definition: main.c:4
void SIOHandler(int)
void(*)(int) SSignal(int signum, void(*handler)(int))
Definition: sio.h:237
#define SLongjmp(a, b)
Definition: sio.h:40
#define Sjmp_buf
Definition: sio.h:41