blob: 3df08568c490c4f2dfcc2d49cee6fda82ce67b62 (
plain) (
blame)
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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
|
#ifndef _NGX_CONFIG_H_INCLUDED_
#define _NGX_CONFIG_H_INCLUDED_
#include <ngx_auto_config.h>
/*
auto_conf
ngx_inline inline __inline __inline__
*/
/* STUB */
#undef FD_SETSIZE
#define FD_SETSIZE 1024
/* auto_conf */
#define NGX_ALIGN (4 - 1)
#define NGX_ALIGN_TYPE unsigned
#define ngx_align(p) (char *) (((NGX_ALIGN_TYPE) p + NGX_ALIGN) & ~NGX_ALIGN)
/* Platform specific: array[NGX_INVALID_ARRAY_INDEX] should cause SIGSEGV */
#define NGX_INVALID_ARRAY_INDEX 0x80000000
#ifdef _WIN32
#define WIN32 1
#include <winsock2.h>
#include <mswsock.h>
#include <stddef.h> /* offsetof */
#include <stdio.h>
#include <stdarg.h>
#define ngx_inline __inline
#ifndef HAVE_INHERITED_NONBLOCK
#define HAVE_INHERITED_NONBLOCK 1
#endif
#ifndef HAVE_WIN32_TRANSMITPACKETS
#define HAVE_WIN32_TRANSMITPACKETS 1
#define HAVE_WIN32_TRANSMITFILE 0
#endif
#ifndef HAVE_WIN32_TRANSMITFILE
#define HAVE_WIN32_TRANSMITFILE 1
#endif
#if (HAVE_WIN32_TRANSMITPACKETS) || (HAVE_WIN32_TRANSMITFILE)
#define HAVE_SENDFILE 1
#endif
#else /* POSIX */
/* Solaris */
#if defined(sun) && (defined(__svr4__) || defined(__SVR4))
#define SOLARIS 1
#define _FILE_OFFSET_BITS 64 /* should be before sys/types.h */
#ifndef HAVE_INHERITED_NONBLOCK
#define HAVE_INHERITED_NONBLOCK 1
#endif
#include <sys/stropts.h> /* INFTIM */
#endif /* Solaris */
#include <unistd.h>
#include <stddef.h> /* offsetof */
#include <stdlib.h>
#include <stdio.h>
#include <stdarg.h>
#include <fcntl.h>
#include <signal.h>
#include <string.h>
#include <sys/types.h>
#include <sys/wait.h>
#include <sys/time.h>
#include <sys/socket.h>
#include <sys/uio.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <netdb.h>
#ifndef HAVE_POLL
#define HAVE_POLL 1
#include <poll.h>
#endif
#if (HAVE_DEVPOLL)
#include <sys/ioctl.h>
#include <sys/devpoll.h> /* Solaris, HP/UX */
#endif
#if (HAVE_AIO)
#include <aio.h>
#endif
#define ngx_inline inline
#endif /* POSIX */
#define LF 10
#define CR 13
#define CRLF "\x0d\x0a"
#ifndef INET_ADDRSTRLEN
#define INET_ADDRSTRLEN 16
#endif
#if defined SO_ACCEPTFILTER || defined TCP_DEFER_ACCEPT
#ifndef HAVE_DEFERRED_ACCEPT
#define HAVE_DEFERRED_ACCEPT 1
#endif
#endif
#ifndef HAVE_SELECT
#define HAVE_SELECT 1
#endif
#ifdef __FreeBSD__
#include <osreldate.h>
#ifndef HAVE_INHERITED_NONBLOCK
#define HAVE_INHERITED_NONBLOCK 1
#endif
/* FreeBSD sendfile */
#if __FreeBSD_version >= 300007
#ifndef HAVE_FREEBSD_SENDFILE
#define HAVE_FREEBSD_SENDFILE 1
#endif
#ifndef HAVE_FREEBSD_SENDFILE_NBYTES_BUG
#define HAVE_FREEBSD_SENDFILE_NBYTES_BUG 2
#endif
#endif /* FreeBSD sendfile */
/* FreeBSD sendfile nbytes bug */
#if (__FreeBSD__ == 4 && __FreeBSD_version >= 460100) \
|| __FreeBSD_version == 460001
|| __FreeBSD_version >= 500029
#if (HAVE_FREEBSD_SENDFILE_NBYTES_BUG == 2)
#define HAVE_FREEBSD_SENDFILE_NBYTES_BUG 0
#endif
#endif /* FreeBSD sendfile nbytes bug */
#if (HAVE_FREEBSD_SENDFILE)
#define HAVE_SENDFILE 1
#endif
/* FreeBSD kqueue */
#if (__FreeBSD__ == 4 && __FreeBSD_version >= 410000) \
|| __FreeBSD_version >= 500011
#ifndef HAVE_KQUEUE
#define HAVE_KQUEUE 1
#include <sys/event.h>
#endif
/* kqueue's NOTE_LOWAT */
#if (__FreeBSD__ == 4 && __FreeBSD_version >= 430000) \
|| __FreeBSD_version >= 500018
#ifndef HAVE_LOWAT_EVENT
#define HAVE_LOWAT_EVENT 1
#endif
#endif
#endif /* FreeBSD kqueue */
#endif /* __FreeBSD__ */
#ifdef __SOME_OS_TEMPLATE__
#ifndef HAVE_INHERITED_NONBLOCK
#define HAVE_INHERITED_NONBLOCK 1
#endif
#endif
#endif /* _NGX_CONFIG_H_INCLUDED_ */
|