comparison src/core/ngx_config.h @ 93:738fe44c70d5

nginx-0.0.1-2003-05-21-17:28:21 import
author Igor Sysoev <igor@sysoev.ru>
date Wed, 21 May 2003 13:28:21 +0000
parents 19cc647ecd91
children 8220378432a8
comparison
equal deleted inserted replaced
92:19cc647ecd91 93:738fe44c70d5
2 #define _NGX_CONFIG_H_INCLUDED_ 2 #define _NGX_CONFIG_H_INCLUDED_
3 3
4 4
5 #include <ngx_auto_config.h> 5 #include <ngx_auto_config.h>
6 6
7 /*
8 auto_conf
9 ngx_inline inline __inline __inline__
10 */
11 7
12 /* STUB */ 8 #if defined __FreeBSD__
9 #include <ngx_freebsd_config.h>
10
11
12 #elif defined __linux__
13 #include <ngx_linux_config.h>
14
15
16 /* Solaris */
17 #elif defined(sun) && (defined(__svr4__) || defined(__SVR4))
18 #include <ngx_solaris_config.h>
19
20
21 #elif defined _WIN32
22
23 /* STUB to allocate a big ngx_connections */
13 #undef FD_SETSIZE 24 #undef FD_SETSIZE
14 #define FD_SETSIZE 1024 25 #define FD_SETSIZE 1024
15 26
27 #include <ngx_win32_config.h>
16 28
17 /* auto_conf */
18 #define NGX_ALIGN (4 - 1)
19 #define NGX_ALIGN_TYPE unsigned
20 29
21 #define ngx_align(p) (char *) (((NGX_ALIGN_TYPE) p + NGX_ALIGN) & ~NGX_ALIGN) 30 #else /* posix */
31
32 #endif
22 33
23 34
24 35
25 /* Platform specific: array[NGX_INVALID_ARRAY_INDEX] should cause SIGSEGV */ 36 /* TODO: platform specific: array[NGX_INVALID_ARRAY_INDEX] must cause SIGSEGV */
26 #define NGX_INVALID_ARRAY_INDEX 0x80000000 37 #define NGX_INVALID_ARRAY_INDEX 0x80000000
27 38
28 39
29 #ifdef _WIN32 40 /* TODO: auto_conf */
41 #define NGX_ALIGN (4 - 1)
42 #define NGX_ALIGN_TYPE (unsigned int)
30 43
31 #define WIN32 1 44 #define ngx_align(p) (char *) ((NGX_ALIGN_TYPE p + NGX_ALIGN) & ~NGX_ALIGN)
32
33 #include <winsock2.h>
34 #include <mswsock.h>
35 #include <stddef.h> /* offsetof */
36 #include <stdio.h>
37 #include <stdarg.h>
38 45
39 46
40 #define ngx_inline __inline 47 /* TODO: auto_conf: ngx_inline inline __inline __inline__ */
41 48 #ifndef ngx_inline
42 49 #define ngx_inline inline
43 #ifndef HAVE_INHERITED_NONBLOCK
44 #define HAVE_INHERITED_NONBLOCK 1
45 #endif
46
47 #ifndef HAVE_WIN32_TRANSMITPACKETS
48 #define HAVE_WIN32_TRANSMITPACKETS 1
49 #define HAVE_WIN32_TRANSMITFILE 0
50 #endif
51
52 #ifndef HAVE_WIN32_TRANSMITFILE
53 #define HAVE_WIN32_TRANSMITFILE 1
54 #endif
55
56 #if (HAVE_WIN32_TRANSMITPACKETS) || (HAVE_WIN32_TRANSMITFILE)
57 #define HAVE_SENDFILE 1
58 #endif
59
60 #else /* POSIX */
61
62
63
64 /* Solaris */
65 #if defined(sun) && (defined(__svr4__) || defined(__SVR4))
66
67 #define SOLARIS 1
68
69 #define _FILE_OFFSET_BITS 64 /* should be before sys/types.h */
70
71 #ifndef HAVE_INHERITED_NONBLOCK
72 #define HAVE_INHERITED_NONBLOCK 1
73 #endif
74
75 #include <sys/stropts.h> /* INFTIM */
76
77 #endif /* Solaris */
78
79
80
81 #include <unistd.h>
82 #include <stddef.h> /* offsetof */
83 #include <stdlib.h>
84 #include <stdio.h>
85 #include <stdarg.h>
86 #include <fcntl.h>
87 #include <signal.h>
88 #include <string.h>
89 #include <sys/types.h>
90 #include <sys/mman.h>
91 #include <sys/wait.h>
92 #include <sys/time.h>
93 #include <sys/socket.h>
94 #include <sys/uio.h>
95 #include <sys/resource.h>
96 #include <netinet/in.h>
97 #include <arpa/inet.h>
98 #include <netdb.h>
99
100
101 #ifndef HAVE_POLL
102 #define HAVE_POLL 1
103 #include <poll.h>
104 #endif 50 #endif
105 51
106 52
107 #if (HAVE_DEVPOLL) && !(TEST_DEVPOLL) 53 #ifndef INADDR_NONE /* Solaris */
108 #include <sys/ioctl.h> 54 #define INADDR_NONE ((unsigned long) -1)
109 #include <sys/devpoll.h> /* Solaris, HP/UX */
110 #endif 55 #endif
111
112
113 #if (HAVE_AIO)
114 #include <aio.h>
115 #endif
116
117
118 #define ngx_inline inline
119
120
121 #endif /* POSIX */
122
123
124
125 #define LF 10
126 #define CR 13
127 #define CRLF "\x0d\x0a"
128
129 56
130 #ifndef INET_ADDRSTRLEN 57 #ifndef INET_ADDRSTRLEN
131 #define INET_ADDRSTRLEN 16 58 #define INET_ADDRSTRLEN 16
132 #endif 59 #endif
133 60
134 61
135 #if defined SO_ACCEPTFILTER || defined TCP_DEFER_ACCEPT
136
137 #ifndef HAVE_DEFERRED_ACCEPT
138 #define HAVE_DEFERRED_ACCEPT 1
139 #endif
140
141 #endif
142
143
144 #ifndef HAVE_SELECT
145 #define HAVE_SELECT 1
146 #endif
147
148
149 #ifdef __FreeBSD__
150
151 #include <osreldate.h>
152
153 #ifndef HAVE_INHERITED_NONBLOCK
154 #define HAVE_INHERITED_NONBLOCK 1
155 #endif
156
157 /* FreeBSD sendfile */
158 #if __FreeBSD_version >= 300007
159
160 #ifndef HAVE_FREEBSD_SENDFILE
161 #define HAVE_FREEBSD_SENDFILE 1
162 #endif
163
164 #ifndef HAVE_FREEBSD_SENDFILE_NBYTES_BUG
165 #define HAVE_FREEBSD_SENDFILE_NBYTES_BUG 2
166 #endif
167
168 #endif /* FreeBSD sendfile */
169
170 /* FreeBSD sendfile nbytes bug */
171 #if (__FreeBSD__ == 4 && __FreeBSD_version >= 460100) \
172 || __FreeBSD_version == 460001 \
173 || __FreeBSD_version >= 500029
174
175 #if (HAVE_FREEBSD_SENDFILE_NBYTES_BUG == 2)
176 #undef HAVE_FREEBSD_SENDFILE_NBYTES_BUG
177 #define HAVE_FREEBSD_SENDFILE_NBYTES_BUG 0
178 #endif
179
180 #endif /* FreeBSD sendfile nbytes bug */
181
182 #if (HAVE_FREEBSD_SENDFILE)
183 #define HAVE_SENDFILE 1
184 #endif
185
186
187 /* FreeBSD kqueue */
188 #if (__FreeBSD__ == 4 && __FreeBSD_version >= 410000) \
189 || __FreeBSD_version >= 500011
190
191 #ifndef HAVE_KQUEUE
192 #define HAVE_KQUEUE 1
193 #include <sys/event.h>
194 #endif
195
196 /* kqueue's NOTE_LOWAT */
197 #if (__FreeBSD__ == 4 && __FreeBSD_version >= 430000) \
198 || __FreeBSD_version >= 500018
199
200 #ifndef HAVE_LOWAT_EVENT
201 #define HAVE_LOWAT_EVENT 1
202 #endif
203
204 #endif
205
206 #endif /* FreeBSD kqueue */
207
208
209 #endif /* __FreeBSD__ */
210
211
212 #ifdef __SOME_OS_TEMPLATE__
213
214 #ifndef HAVE_INHERITED_NONBLOCK
215 #define HAVE_INHERITED_NONBLOCK 1
216 #endif
217
218 #endif
219
220
221 #endif /* _NGX_CONFIG_H_INCLUDED_ */ 62 #endif /* _NGX_CONFIG_H_INCLUDED_ */