The FreeRADIUS server  $Id: 15bac2a4c627c01d1aa2047687b3418955ac7f00 $
exec_priv.h
Go to the documentation of this file.
1 #pragma once
2 /*
3  * This program is free software; you can redistribute it and/or modify
4  * it under the terms of the GNU General Public License as published by
5  * the Free Software Foundation; either version 2 of the License, or
6  * (at your option) any later version.
7  *
8  * This program is distributed in the hope that it will be useful,
9  * but WITHOUT ANY WARRANTY; without even the implied warranty of
10  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11  * GNU General Public License for more details.
12  *
13  * You should have received a copy of the GNU General Public License
14  * along with this program; if not, write to the Free Software
15  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
16  */
17 
18 /**
19  * $Id: f80deb6c26dcf8764ddde8b237e4bfa2d56f0fa3 $
20  *
21  * @file lib/server/exec_priv.h
22  * @brief Private exec APIs
23  *
24  * @copyright 2014 The FreeRADIUS server project
25  */
26 RCSIDH(exec_priv_h, "$Id: f80deb6c26dcf8764ddde8b237e4bfa2d56f0fa3 $")
27 
28 #include <freeradius-devel/server/exec.h>
29 
30 #include <freeradius-devel/unlang/interpret.h>
31 
32 #include <freeradius-devel/util/dlist.h>
33 #include <freeradius-devel/util/misc.h>
34 #include <freeradius-devel/util/pair_legacy.h>
35 #include <freeradius-devel/util/syserror.h>
36 #include <freeradius-devel/util/atexit.h>
37 
38 #include <sys/types.h>
39 
40 #include <freeradius-devel/protocol/freeradius/freeradius.internal.h>
41 
42 #include <sys/file.h>
43 
44 #include <fcntl.h>
45 #include <ctype.h>
46 #include <signal.h>
47 
48 
49 #ifdef __cplusplus
50 extern "C" {
51 #endif
52 
53 #if defined(__APPLE__) || defined(__FreeBSD__)
54 extern char **environ;
55 #else
56 # include <unistd.h>
57 #endif
58 
59 #ifdef HAVE_SYS_WAIT_H
60 # include <sys/wait.h>
61 #endif
62 #ifndef WEXITSTATUS
63 # define WEXITSTATUS(stat_val) ((unsigned)(stat_val) >> 8)
64 #endif
65 #ifndef WIFEXITED
66 # define WIFEXITED(stat_val) (((stat_val) & 0x7f) == 0)
67 #endif
68 
69 #if defined(OpenBSD)
70 /*
71  * The standard closefrom() returns void.
72  * OpenBSD's closefrom ()returns int and can be EINTR'd.
73  * So we have to keep calling it until it no longer returns EINTR
74  */
75 #define fr_closefrom(_x) do { \
76  errno = 0; \
77  closefrom(_x); \
78  } while (errno == EINTR) \
79 
80 #else
81 #define fr_closefrom closefrom
82 #endif
83 
84 #ifdef __cplusplus
85 }
86 #endif
#define RCSIDH(h, id)
Definition: build.h:445
Signals that can be sent to a request.