1 /*
2  * Copyright (C) 2013 Nikos Mavrogiannopoulos
3  *
4  * Author: Nikos Mavrogiannopoulos
5  *
6  * This file is part of ocserv.
7  *
8  * ocserv is free software; you can redistribute it and/or
9  * modify it under the terms of the GNU Lesser General Public License
10  * as published by the Free Software Foundation; either version 2.1 of
11  * the License, or (at your option) any later version.
12  *
13  * This library is distributed in the hope that it will be useful, but
14  * WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
16  * Lesser General Public License for more details.
17  *
18  * You should have received a copy of the GNU Lesser General Public License
19  * along with this program.  If not, see <http://www.gnu.org/licenses/>
20  */
21 #ifndef DIE_H
22 # define DIE_H
23 
24 # include <config.h>
25 # include <signal.h>
26 # include <unistd.h>
27 
28 #ifdef HAVE_SIGHANDLER_T
29 # define SIGHANDLER_T sighandler_t
30 #elif HAVE_SIG_T
31 # define SIGHANDLER_T sig_t
32 #elif HAVE___SIGHANDLER_T
33 # define SIGHANDLER_T __sighandler_t
34 #else
35 typedef void (*sighandler_t)(int);
36 # define SIGHANDLER_T sighandler_t
37 #endif
38 
39 void pr_set_undumpable(const char* mod);
40 void kill_on_parent_kill(int sig);
41 
42 SIGHANDLER_T ocsignal(int signum, SIGHANDLER_T handler);
43 
44 int check_upeer_id(const char *mod, int debug, int cfg, uid_t uid, uid_t gid, uid_t *ruid, pid_t *pid);
45 
46 
47 
48 #endif
49