3 * Copyright (C) Igor Sysoev
4 * Copyright (C) Nginx, Inc.
8 #ifndef _NGX_POSIX_CONFIG_H_INCLUDED_
9 #define _NGX_POSIX_CONFIG_H_INCLUDED_
14 #define _XOPEN_SOURCE_EXTENDED 1
15 #define _HPUX_ALT_XOPEN_SOCKET_API
26 #define _GNU_SOURCE /* accept4() */
28 #define _FILE_OFFSET_BITS 64
33 #define timezonevar /* timezone is variable */
34 #define NGX_BROKEN_SCM_RIGHTS 1
38 #include <sys/types.h>
40 #if (NGX_HAVE_UNISTD_H)
43 #if (NGX_HAVE_INTTYPES_H)
47 #include <stddef.h> /* offsetof() */
59 #if (NGX_HAVE_SYS_PARAM_H)
60 #include <sys/param.h> /* statfs() */
62 #if (NGX_HAVE_SYS_MOUNT_H)
63 #include <sys/mount.h> /* statfs() */
65 #if (NGX_HAVE_SYS_STATVFS_H)
66 #include <sys/statvfs.h> /* statvfs() */
69 #if (NGX_HAVE_SYS_FILIO_H)
70 #include <sys/filio.h> /* FIONBIO */
72 #include <sys/ioctl.h> /* FIONBIO */
80 #include <sys/resource.h>
83 #include <sys/socket.h>
84 #include <netinet/in.h>
85 #include <netinet/tcp.h> /* TCP_NODELAY */
86 #include <arpa/inet.h>
90 #if (NGX_HAVE_LIMITS_H)
91 #include <limits.h> /* IOV_MAX */
95 #include <malloc.h> /* memalign() */
98 #if (NGX_HAVE_CRYPT_H)
108 #include <ngx_auto_config.h>
111 #if (NGX_HAVE_DLOPEN)
116 #if (NGX_HAVE_POSIX_SEM)
117 #include <semaphore.h>
126 #if (NGX_HAVE_KQUEUE)
127 #include <sys/event.h>
131 #if (NGX_HAVE_DEVPOLL) && !(NGX_TEST_BUILD_DEVPOLL)
132 #include <sys/ioctl.h>
133 #include <sys/devpoll.h>
137 #if (NGX_HAVE_FILE_AIO)
139 typedef struct aiocb ngx_aiocb_t;
143 #define NGX_LISTEN_BACKLOG 511
145 #define ngx_debug_init()
148 #if (__FreeBSD__) && (__FreeBSD_version < 400017)
150 #include <sys/param.h> /* ALIGN() */
153 * FreeBSD 3.x has no CMSG_SPACE() and CMSG_LEN() and has the broken CMSG_DATA()
157 #define CMSG_SPACE(l) (ALIGN(sizeof(struct cmsghdr)) + ALIGN(l))
160 #define CMSG_LEN(l) (ALIGN(sizeof(struct cmsghdr)) + (l))
163 #define CMSG_DATA(cmsg) ((u_char *)(cmsg) + ALIGN(sizeof(struct cmsghdr)))
168 extern char **environ;
171 #endif /* _NGX_POSIX_CONFIG_H_INCLUDED_ */