Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025 #ifndef _ink_platform_h
00026 #define _ink_platform_h
00027
00028 #include "ink_config.h"
00029
00030 #include <stdio.h>
00031 #include <stdarg.h>
00032 #ifdef HAVE_STDLIB_H
00033 # include <stdlib.h>
00034 #endif
00035 #include <ctype.h>
00036 #ifdef HAVE_STRING_H
00037 # include <string.h>
00038 #endif
00039 #ifdef HAVE_STRINGS_H
00040 # include <strings.h>
00041 #endif
00042 #include <errno.h>
00043 #ifdef HAVE_SYS_TYPES_H
00044 #include <sys/types.h>
00045 #endif
00046 #ifdef HAVE_SYS_STAT_H
00047 # include <sys/stat.h>
00048 #endif
00049 #include <fcntl.h>
00050
00051 #include <limits.h>
00052 #ifdef HAVE_UNISTD_H
00053 # include <unistd.h>
00054 #endif
00055 #include <sys/stat.h>
00056 #include <assert.h>
00057 #include <time.h>
00058 #include <sys/time.h>
00059 #include <sys/uio.h>
00060 #include <sys/file.h>
00061 #include <sys/resource.h>
00062
00063 #include <sys/ipc.h>
00064 #include <sys/shm.h>
00065 #include <sys/sem.h>
00066
00067 #include <sys/param.h>
00068 #include <sys/un.h>
00069
00070 #include <sys/wait.h>
00071 #include <sys/socket.h>
00072 #include <sys/mman.h>
00073
00074 #ifdef HAVE_NETINET_IN_H
00075 # include <netinet/in.h>
00076 #endif
00077 #ifdef HAVE_NETINET_IN_SYSTM_H
00078 # include <netinet/in_systm.h>
00079 #endif
00080 #ifdef HAVE_NETINET_TCP_H
00081 # include <netinet/tcp.h>
00082 #endif
00083 #ifdef HAVE_NETINET_IP_H
00084 # include <netinet/ip.h>
00085 #endif
00086 #ifdef HAVE_NETINET_IP_ICMP_H
00087 # include <netinet/ip_icmp.h>
00088 #endif
00089 #ifdef HAVE_NETDB_H
00090 # include <netdb.h>
00091 #endif
00092 #ifdef HAVE_ARPA_INET_H
00093 # include <arpa/inet.h>
00094 #endif
00095 #ifdef HAVE_ARPA_NAMESER_H
00096 # include <arpa/nameser.h>
00097 #endif
00098 #ifdef HAVE_ARPA_NAMESER_COMPAT_H
00099 # include <arpa/nameser_compat.h>
00100 #endif
00101
00102 #include <signal.h>
00103 #ifdef HAVE_SIGINFO_H
00104 # include <siginfo.h>
00105 #endif
00106 #ifdef HAVE_WAIT_H
00107 # include <wait.h>
00108 #endif
00109
00110 #include <syslog.h>
00111 #include <pwd.h>
00112 #include <poll.h>
00113
00114 #if TS_USE_EPOLL
00115 #include <sys/epoll.h>
00116 #endif
00117 #if TS_USE_KQUEUE
00118 #include <sys/event.h>
00119 #endif
00120 #if TS_USE_PORT
00121 #include <port.h>
00122 #endif
00123
00124
00125 #ifdef HAVE_VALUES_H
00126 # include <values.h>
00127 #endif
00128 #ifdef HAVE_ALLOCA_H
00129 # include <alloca.h>
00130 #endif
00131
00132 #include <errno.h>
00133 #include <dirent.h>
00134
00135 #ifdef HAVE_CPIO_H
00136 # include <cpio.h>
00137 #endif
00138
00139 struct ifafilt;
00140 #include <net/if.h>
00141
00142 #ifdef HAVE_STROPTS_H
00143 #include <stropts.h>
00144 #endif
00145
00146
00147
00148
00149
00150 #if defined(__GNUC__) && !defined(__STDC__)
00151 #define __STDC__ 0
00152 #endif
00153
00154 #ifdef HAVE_MACHINE_ENDIAN_H
00155 # include <machine/endian.h>
00156 #endif
00157 #ifdef HAVE_ENDIAN_H
00158 # include <endian.h>
00159 #endif
00160 #ifdef HAVE_SYS_BYTEORDER_H
00161 # include <sys/byteorder.h>
00162 #endif
00163
00164 #ifdef HAVE_SYS_IOCTL_H
00165 # include <sys/ioctl.h>
00166 #endif
00167 #ifdef HAVE_SYS_SOCKIO_H
00168 # include <sys/sockio.h>
00169 #endif
00170
00171 #include <resolv.h>
00172
00173
00174 #if defined(linux)
00175 typedef unsigned int in_addr_t;
00176 #endif
00177
00178 #ifdef HAVE_SYS_SYSINFO_H
00179 # include <sys/sysinfo.h>
00180 #endif
00181
00182 #if !defined(darwin)
00183 # ifdef HAVE_SYS_SYSCTL_H
00184 # include <sys/sysctl.h>
00185 # endif
00186 #endif
00187 #ifdef HAVE_SYS_SYSTEMINFO_H
00188 # include <sys/systeminfo.h>
00189 #endif
00190
00191 #ifdef HAVE_DLFCN_H
00192 # include <dlfcn.h>
00193 #endif
00194 #ifdef HAVE_MATH_H
00195 # include <math.h>
00196 #endif
00197 #ifdef HAVE_FLOAT_H
00198 # include <float.h>
00199 #endif
00200
00201 #ifdef HAVE_SYS_SYSMACROS_H
00202 # include <sys/sysmacros.h>
00203 #endif
00204
00205 #ifdef HAVE_SYS_PRCTL_H
00206 #include <sys/prctl.h>
00207 #endif
00208
00209
00210 #ifndef PATH_NAME_MAX
00211 #define PATH_NAME_MAX 4096 // instead of PATH_MAX which is inconsistent
00212
00213
00214 #endif
00215
00216 #endif