Anope IRC Services  Version 2.0
sigaction.cpp
Go to the documentation of this file.
1  /* POSIX emulation layer for Windows.
2  *
3  * Copyright (C) 2008-2014 Anope Team <team@anope.org>
4  *
5  * Please read COPYING and README for further details.
6  *
7  * Based on the original code of Epona by Lara.
8  * Based on the original code of Services by Andy Church.
9  */
10 
11  #include <windows.h>
12  #include "sigaction.h"
13  #include <signal.h>
14 
15  int sigaction(int sig, struct sigaction *action, struct sigaction *old)
16  {
17  if (sig == -1)
18  return 0;
19  if (old == NULL)
20  {
21  if (signal(sig, SIG_DFL) == SIG_ERR)
22  return -1;
23  }
24  else
25  {
26  if (signal(sig, action->sa_handler) == SIG_ERR)
27  return -1;
28  }
29  return 0;
30  }
31 
int sigaction(int sig, struct sigaction *action, struct sigaction *old)
Definition: sigaction.cpp:15
void(* sa_handler)(int)
Definition: sigaction.h:22