upstream nginx-0.7.31
[nginx.git] / nginx / src / os / unix / ngx_posix_config.h
1
2 /*
3  * Copyright (C) Igor Sysoev
4  */
5
6
7 #ifndef _NGX_POSIX_CONFIG_H_INCLUDED_
8 #define _NGX_POSIX_CONFIG_H_INCLUDED_
9
10
11 #if (NGX_HPUX)
12 #define _XOPEN_SOURCE
13 #define _XOPEN_SOURCE_EXTENDED  1
14 #endif
15
16
17 #if (NGX_TRU64)
18 #define _REENTRANT
19 #endif
20
21
22 #ifdef __CYGWIN__
23 #define timezonevar             /* timezone is variable */
24 #define NGX_BROKEN_SCM_RIGHTS   1
25 #endif
26
27
28 #include <sys/types.h>
29 #include <sys/time.h>
30 #if (NGX_HAVE_UNISTD_H)
31 #include <unistd.h>
32 #endif
33 #if (NGX_HAVE_INTTYPES_H)
34 #include <inttypes.h>
35 #endif
36 #include <stdarg.h>
37 #include <stddef.h>             /* offsetof() */
38 #include <stdio.h>
39 #include <stdlib.h>
40 #include <errno.h>
41 #include <string.h>
42 #include <signal.h>
43 #include <pwd.h>
44 #include <grp.h>
45 #include <dirent.h>
46 #include <glob.h>
47
48 #if (NGX_HAVE_SYS_FILIO_H)
49 #include <sys/filio.h>          /* FIONBIO */
50 #endif
51 #include <sys/ioctl.h>          /* FIONBIO */
52
53 #include <sys/uio.h>
54 #include <sys/stat.h>
55 #include <fcntl.h>
56
57 #include <sys/wait.h>
58 #include <sys/mman.h>
59 #include <sys/resource.h>
60 #include <sched.h>
61
62 #include <sys/socket.h>
63 #include <netinet/in.h>
64 #include <netinet/tcp.h>        /* TCP_NODELAY */
65 #include <arpa/inet.h>
66 #include <netdb.h>
67 #include <sys/un.h>
68
69 #if (NGX_HAVE_LIMITS_H)
70 #include <limits.h>             /* IOV_MAX */
71 #endif
72
73 #ifdef __CYGWIN__
74 #include <malloc.h>             /* memalign() */
75 #endif
76
77 #if (NGX_HAVE_CRYPT_H)
78 #include <crypt.h>
79 #endif
80
81
82 #ifndef IOV_MAX
83 #define IOV_MAX   16
84 #endif
85
86
87 #include <ngx_auto_config.h>
88
89
90 #if (NGX_HAVE_POLL)
91 #include <poll.h>
92 #endif
93
94
95 #if (NGX_HAVE_KQUEUE)
96 #include <sys/event.h>
97 #endif
98
99
100 #if (NGX_HAVE_DEVPOLL)
101 #include <sys/ioctl.h>
102 #include <sys/devpoll.h>
103 #endif
104
105
106 #define NGX_LISTEN_BACKLOG  511
107
108
109 #if (__FreeBSD__) && (__FreeBSD_version < 400017)
110
111 #include <sys/param.h>          /* ALIGN() */
112
113 /*
114  * FreeBSD 3.x has no CMSG_SPACE() and CMSG_LEN() and has the broken CMSG_DATA()
115  */
116
117 #undef  CMSG_SPACE
118 #define CMSG_SPACE(l)       (ALIGN(sizeof(struct cmsghdr)) + ALIGN(l))
119
120 #undef  CMSG_LEN
121 #define CMSG_LEN(l)         (ALIGN(sizeof(struct cmsghdr)) + (l))
122
123 #undef  CMSG_DATA
124 #define CMSG_DATA(cmsg)     ((u_char *)(cmsg) + ALIGN(sizeof(struct cmsghdr)))
125
126 #endif
127
128
129 extern char **environ;
130
131
132 #endif /* _NGX_POSIX_CONFIG_H_INCLUDED_ */