summaryrefslogtreecommitdiffstats
path: root/lib/base/unix.hpp
blob: 7413a5b15e020c0201e52f32c2cd215ff0d297a6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
/* Icinga 2 | (c) 2012 Icinga GmbH | GPLv2+ */

#ifndef UNIX_H
#define UNIX_H

#include <limits.h>
#include <unistd.h>
#include <fcntl.h>
#include <sys/socket.h>
#include <sys/types.h>
#include <sys/un.h>
#include <netdb.h>
#include <sys/ioctl.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <libgen.h>
#include <syslog.h>
#include <sys/file.h>
#include <sys/wait.h>
#include <glob.h>
#include <dlfcn.h>
#include <sys/stat.h>
#include <dirent.h>
#include <sys/time.h>
#include <sys/resource.h>
#include <strings.h>
#include <errno.h>

typedef int SOCKET;
#define INVALID_SOCKET (-1)

#define closesocket close
#define ioctlsocket ioctl

#ifndef SUN_LEN
/* TODO: Ideally this should take into the account how
 * long the socket path really is.
 */
#	define SUN_LEN(sun) (sizeof(sockaddr_un))
#endif /* SUN_LEN */

#ifndef PATH_MAX
#	define PATH_MAX 1024
#endif /* PATH_MAX */

#ifndef MAXPATHLEN
#	define MAXPATHLEN PATH_MAX
#endif /* MAXPATHLEN */
#endif /* UNIX_H */