]> granicus.if.org Git - icinga2/blob - lib/base/unix.hpp
Merge pull request #7185 from Icinga/bugfix/gelfwriter-wrong-log-facility
[icinga2] / lib / base / unix.hpp
1 /* Icinga 2 | (c) 2012 Icinga GmbH | GPLv2+ */
2
3 #ifndef UNIX_H
4 #define UNIX_H
5
6 #include <limits.h>
7 #include <unistd.h>
8 #include <fcntl.h>
9 #include <sys/socket.h>
10 #include <sys/types.h>
11 #include <sys/un.h>
12 #include <netdb.h>
13 #include <sys/ioctl.h>
14 #include <netinet/in.h>
15 #include <arpa/inet.h>
16 #include <libgen.h>
17 #include <syslog.h>
18 #include <sys/file.h>
19 #include <sys/wait.h>
20 #include <glob.h>
21 #include <dlfcn.h>
22 #include <sys/stat.h>
23 #include <dirent.h>
24 #include <sys/time.h>
25 #include <sys/resource.h>
26 #include <strings.h>
27 #include <errno.h>
28
29 typedef int SOCKET;
30 #define INVALID_SOCKET (-1)
31
32 #define closesocket close
33 #define ioctlsocket ioctl
34
35 #ifndef SUN_LEN
36 /* TODO: Ideally this should take into the account how
37  * long the socket path really is.
38  */
39 #       define SUN_LEN(sun) (sizeof(sockaddr_un))
40 #endif /* SUN_LEN */
41
42 #ifndef PATH_MAX
43 #       define PATH_MAX 1024
44 #endif /* PATH_MAX */
45
46 #ifndef MAXPATHLEN
47 #       define MAXPATHLEN PATH_MAX
48 #endif /* MAXPATHLEN */
49 #endif /* UNIX_H */