2 Copyright (c) 2003-2006 by Juliusz Chroboczek
4 Permission is hereby granted, free of charge, to any person obtaining a copy
5 of this software and associated documentation files (the "Software"), to deal
6 in the Software without restriction, including without limitation the rights
7 to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8 copies of the Software, and to permit persons to whom the Software is
9 furnished to do so, subject to the following conditions:
11 The above copyright notice and this permission notice shall be included in
12 all copies or substantial portions of the Software.
14 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19 OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
28 #include <sys/param.h>
31 #ifdef __MINGW32_VERSION
48 #ifndef WIN32 /*MINGW*/
50 #include <sys/socket.h>
51 #include <netinet/in.h>
52 #include <netinet/tcp.h>
53 #include <arpa/inet.h>
55 #include <sys/types.h>
59 #include <sys/ioctl.h>
64 #define MAP_ANONYMOUS MAP_ANON
67 #if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
69 #elif defined(__GNUC__)
70 #define inline __inline
72 #define restrict __restrict
81 #if defined(__GNUC__) && (__GNUC__ >= 3)
82 #define ATTRIBUTE(x) __attribute__(x)
84 #define ATTRIBUTE(x) /**/
88 #define HAVE_TM_GMTOFF
97 #if (__GLIBC__ > 2) || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 2)
102 #if defined(__linux__) && (__GNU_LIBRARY__ == 1)
109 #define HAVE_TM_GMTOFF
116 #define HAVE_ASPRINTF
125 #if _POSIX_VERSION >= 200112L
132 #if (__GLIBC__ > 2) || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 2)
138 #define HAVE_ASPRINTF
139 #if __FreeBSD_version >= 400000
143 #if __FreeBSD_version >= 503001
149 #if __NetBSD_Version__ >= 105000000
152 #if __NetBSD_Version__ >= 200000000
154 #define HAVE_ASPRINTF
159 #if OpenBSD >= 200311
166 #if defined(i386) || defined(__mc68020__) || defined(__x86_64__)
167 #define UNALIGNED_ACCESS
170 #ifndef WIN32 /*MINGW*/
175 #define HAVE_READV_WRITEV
177 #define READ(x, y, z) read(x, y, z)
178 #define WRITE(x, y, z) write(x, y, z)
179 #define CLOSE(x) close(x)
186 #ifdef HAVE_READV_WRITEV
187 #define WRITEV(x, y, z) writev(x, y, z)
188 #define READV(x, y, z) readv(x, y, z)
192 #define NO_REDIRECTOR
197 #include "ftsimport.h"
210 #include "diskcache.h"
212 #include "http_parse.h"
213 #include "parse_time.h"
214 #include "forbidden.h"
219 extern AtomPtr configFile
;
220 extern int daemonise
;
221 extern AtomPtr pidFile
;