Mercurial > hg > nginx-quic
annotate src/os/unix/ngx_posix_config.h @ 5355:32847478c2c1
Added the NGX_EBADF define.
author | Valentin Bartenev <vbart@nginx.com> |
---|---|
date | Mon, 02 Sep 2013 08:07:44 +0400 |
parents | 489839d07b38 |
children | 72e31d88defa |
rev | line source |
---|---|
441
da8c5707af39
nginx-0.1.0-2004-09-28-12:34:51 import; set copyright and remove unused files
Igor Sysoev <igor@sysoev.ru>
parents:
374
diff
changeset
|
1 |
da8c5707af39
nginx-0.1.0-2004-09-28-12:34:51 import; set copyright and remove unused files
Igor Sysoev <igor@sysoev.ru>
parents:
374
diff
changeset
|
2 /* |
444
42d11f017717
nginx-0.1.0-2004-09-29-20:00:49 import; remove years from copyright
Igor Sysoev <igor@sysoev.ru>
parents:
441
diff
changeset
|
3 * Copyright (C) Igor Sysoev |
4412 | 4 * Copyright (C) Nginx, Inc. |
441
da8c5707af39
nginx-0.1.0-2004-09-28-12:34:51 import; set copyright and remove unused files
Igor Sysoev <igor@sysoev.ru>
parents:
374
diff
changeset
|
5 */ |
da8c5707af39
nginx-0.1.0-2004-09-28-12:34:51 import; set copyright and remove unused files
Igor Sysoev <igor@sysoev.ru>
parents:
374
diff
changeset
|
6 |
da8c5707af39
nginx-0.1.0-2004-09-28-12:34:51 import; set copyright and remove unused files
Igor Sysoev <igor@sysoev.ru>
parents:
374
diff
changeset
|
7 |
355
0fb6c53fb135
nginx-0.0.7-2004-06-15-21:47:16 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
8 #ifndef _NGX_POSIX_CONFIG_H_INCLUDED_ |
0fb6c53fb135
nginx-0.0.7-2004-06-15-21:47:16 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
9 #define _NGX_POSIX_CONFIG_H_INCLUDED_ |
0fb6c53fb135
nginx-0.0.7-2004-06-15-21:47:16 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
10 |
0fb6c53fb135
nginx-0.0.7-2004-06-15-21:47:16 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
11 |
515 | 12 #if (NGX_HPUX) |
455 | 13 #define _XOPEN_SOURCE |
14 #define _XOPEN_SOURCE_EXTENDED 1 | |
4692
489839d07b38
Fixed "sendmsg() failed" alerts on HP-UX.
Maxim Dounin <mdounin@mdounin.ru>
parents:
4557
diff
changeset
|
15 #define _HPUX_ALT_XOPEN_SOCKET_API |
455 | 16 #endif |
17 | |
18 | |
515 | 19 #if (NGX_TRU64) |
467 | 20 #define _REENTRANT |
21 #endif | |
22 | |
23 | |
1576 | 24 #ifdef __CYGWIN__ |
25 #define timezonevar /* timezone is variable */ | |
1581
81774dc3db28
Cygwin can not pass SCM_RIGHTS via unix socket, use signals
Igor Sysoev <igor@sysoev.ru>
parents:
1576
diff
changeset
|
26 #define NGX_BROKEN_SCM_RIGHTS 1 |
1576 | 27 #endif |
28 | |
29 | |
355
0fb6c53fb135
nginx-0.0.7-2004-06-15-21:47:16 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
30 #include <sys/types.h> |
0fb6c53fb135
nginx-0.0.7-2004-06-15-21:47:16 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
31 #include <sys/time.h> |
455 | 32 #if (NGX_HAVE_UNISTD_H) |
355
0fb6c53fb135
nginx-0.0.7-2004-06-15-21:47:16 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
33 #include <unistd.h> |
455 | 34 #endif |
35 #if (NGX_HAVE_INTTYPES_H) | |
36 #include <inttypes.h> | |
37 #endif | |
355
0fb6c53fb135
nginx-0.0.7-2004-06-15-21:47:16 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
38 #include <stdarg.h> |
0fb6c53fb135
nginx-0.0.7-2004-06-15-21:47:16 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
39 #include <stddef.h> /* offsetof() */ |
0fb6c53fb135
nginx-0.0.7-2004-06-15-21:47:16 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
40 #include <stdio.h> |
0fb6c53fb135
nginx-0.0.7-2004-06-15-21:47:16 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
41 #include <stdlib.h> |
0fb6c53fb135
nginx-0.0.7-2004-06-15-21:47:16 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
42 #include <errno.h> |
0fb6c53fb135
nginx-0.0.7-2004-06-15-21:47:16 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
43 #include <string.h> |
0fb6c53fb135
nginx-0.0.7-2004-06-15-21:47:16 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
44 #include <signal.h> |
0fb6c53fb135
nginx-0.0.7-2004-06-15-21:47:16 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
45 #include <pwd.h> |
0fb6c53fb135
nginx-0.0.7-2004-06-15-21:47:16 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
46 #include <grp.h> |
0fb6c53fb135
nginx-0.0.7-2004-06-15-21:47:16 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
47 #include <dirent.h> |
727 | 48 #include <glob.h> |
4557
b13419459a50
Added explicit include of time.h.
Maxim Dounin <mdounin@mdounin.ru>
parents:
4412
diff
changeset
|
49 #include <time.h> |
2659
a3bcaabf2ec8
fix OpenBSD building, broken in r2616
Igor Sysoev <igor@sysoev.ru>
parents:
2615
diff
changeset
|
50 #if (NGX_HAVE_SYS_PARAM_H) |
a3bcaabf2ec8
fix OpenBSD building, broken in r2616
Igor Sysoev <igor@sysoev.ru>
parents:
2615
diff
changeset
|
51 #include <sys/param.h> /* statfs() */ |
a3bcaabf2ec8
fix OpenBSD building, broken in r2616
Igor Sysoev <igor@sysoev.ru>
parents:
2615
diff
changeset
|
52 #endif |
2615 | 53 #if (NGX_HAVE_SYS_MOUNT_H) |
54 #include <sys/mount.h> /* statfs() */ | |
55 #endif | |
56 #if (NGX_HAVE_SYS_STATVFS_H) | |
57 #include <sys/statvfs.h> /* statvfs() */ | |
58 #endif | |
355
0fb6c53fb135
nginx-0.0.7-2004-06-15-21:47:16 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
59 |
455 | 60 #if (NGX_HAVE_SYS_FILIO_H) |
61 #include <sys/filio.h> /* FIONBIO */ | |
62 #endif | |
63 #include <sys/ioctl.h> /* FIONBIO */ | |
64 | |
355
0fb6c53fb135
nginx-0.0.7-2004-06-15-21:47:16 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
65 #include <sys/uio.h> |
0fb6c53fb135
nginx-0.0.7-2004-06-15-21:47:16 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
66 #include <sys/stat.h> |
0fb6c53fb135
nginx-0.0.7-2004-06-15-21:47:16 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
67 #include <fcntl.h> |
0fb6c53fb135
nginx-0.0.7-2004-06-15-21:47:16 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
68 |
0fb6c53fb135
nginx-0.0.7-2004-06-15-21:47:16 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
69 #include <sys/wait.h> |
0fb6c53fb135
nginx-0.0.7-2004-06-15-21:47:16 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
70 #include <sys/mman.h> |
0fb6c53fb135
nginx-0.0.7-2004-06-15-21:47:16 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
71 #include <sys/resource.h> |
374
213f17e9f776
nginx-0.0.7-2004-07-02-09:47:00 import
Igor Sysoev <igor@sysoev.ru>
parents:
355
diff
changeset
|
72 #include <sched.h> |
355
0fb6c53fb135
nginx-0.0.7-2004-06-15-21:47:16 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
73 |
0fb6c53fb135
nginx-0.0.7-2004-06-15-21:47:16 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
74 #include <sys/socket.h> |
0fb6c53fb135
nginx-0.0.7-2004-06-15-21:47:16 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
75 #include <netinet/in.h> |
455 | 76 #include <netinet/tcp.h> /* TCP_NODELAY */ |
355
0fb6c53fb135
nginx-0.0.7-2004-06-15-21:47:16 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
77 #include <arpa/inet.h> |
0fb6c53fb135
nginx-0.0.7-2004-06-15-21:47:16 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
78 #include <netdb.h> |
479 | 79 #include <sys/un.h> |
355
0fb6c53fb135
nginx-0.0.7-2004-06-15-21:47:16 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
80 |
455 | 81 #if (NGX_HAVE_LIMITS_H) |
82 #include <limits.h> /* IOV_MAX */ | |
83 #endif | |
84 | |
1954
d85e291b99f9
it seems that malloc.h is required for Cygwin only
Igor Sysoev <igor@sysoev.ru>
parents:
1901
diff
changeset
|
85 #ifdef __CYGWIN__ |
1576 | 86 #include <malloc.h> /* memalign() */ |
87 #endif | |
88 | |
89 #if (NGX_HAVE_CRYPT_H) | |
90 #include <crypt.h> | |
91 #endif | |
92 | |
93 | |
455 | 94 #ifndef IOV_MAX |
95 #define IOV_MAX 16 | |
96 #endif | |
97 | |
98 | |
355
0fb6c53fb135
nginx-0.0.7-2004-06-15-21:47:16 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
99 #include <ngx_auto_config.h> |
0fb6c53fb135
nginx-0.0.7-2004-06-15-21:47:16 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
100 |
0fb6c53fb135
nginx-0.0.7-2004-06-15-21:47:16 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
101 |
3909
0daede16d68b
use POSIX semaphores in shmtx instead of sched_yield()
Igor Sysoev <igor@sysoev.ru>
parents:
3052
diff
changeset
|
102 #if (NGX_HAVE_POSIX_SEM) |
0daede16d68b
use POSIX semaphores in shmtx instead of sched_yield()
Igor Sysoev <igor@sysoev.ru>
parents:
3052
diff
changeset
|
103 #include <semaphore.h> |
0daede16d68b
use POSIX semaphores in shmtx instead of sched_yield()
Igor Sysoev <igor@sysoev.ru>
parents:
3052
diff
changeset
|
104 #endif |
0daede16d68b
use POSIX semaphores in shmtx instead of sched_yield()
Igor Sysoev <igor@sysoev.ru>
parents:
3052
diff
changeset
|
105 |
0daede16d68b
use POSIX semaphores in shmtx instead of sched_yield()
Igor Sysoev <igor@sysoev.ru>
parents:
3052
diff
changeset
|
106 |
469 | 107 #if (NGX_HAVE_POLL) |
355
0fb6c53fb135
nginx-0.0.7-2004-06-15-21:47:16 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
108 #include <poll.h> |
0fb6c53fb135
nginx-0.0.7-2004-06-15-21:47:16 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
109 #endif |
0fb6c53fb135
nginx-0.0.7-2004-06-15-21:47:16 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
110 |
0fb6c53fb135
nginx-0.0.7-2004-06-15-21:47:16 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
111 |
469 | 112 #if (NGX_HAVE_KQUEUE) |
455 | 113 #include <sys/event.h> |
114 #endif | |
115 | |
116 | |
469 | 117 #if (NGX_HAVE_DEVPOLL) |
455 | 118 #include <sys/ioctl.h> |
119 #include <sys/devpoll.h> | |
120 #endif | |
121 | |
122 | |
3052
6060225e9261
FreeBSD and Linux AIO support
Igor Sysoev <igor@sysoev.ru>
parents:
2659
diff
changeset
|
123 #if (NGX_HAVE_FILE_AIO) |
6060225e9261
FreeBSD and Linux AIO support
Igor Sysoev <igor@sysoev.ru>
parents:
2659
diff
changeset
|
124 #include <aio.h> |
6060225e9261
FreeBSD and Linux AIO support
Igor Sysoev <igor@sysoev.ru>
parents:
2659
diff
changeset
|
125 typedef struct aiocb ngx_aiocb_t; |
6060225e9261
FreeBSD and Linux AIO support
Igor Sysoev <igor@sysoev.ru>
parents:
2659
diff
changeset
|
126 #endif |
6060225e9261
FreeBSD and Linux AIO support
Igor Sysoev <igor@sysoev.ru>
parents:
2659
diff
changeset
|
127 |
6060225e9261
FreeBSD and Linux AIO support
Igor Sysoev <igor@sysoev.ru>
parents:
2659
diff
changeset
|
128 |
1377
0d57c150115b
set default listen() backlog to 511 on all platforms except FreeBSD
Igor Sysoev <igor@sysoev.ru>
parents:
727
diff
changeset
|
129 #define NGX_LISTEN_BACKLOG 511 |
0d57c150115b
set default listen() backlog to 511 on all platforms except FreeBSD
Igor Sysoev <igor@sysoev.ru>
parents:
727
diff
changeset
|
130 |
4223
1b779cb69dc8
malloc() debugging on MacOSX.
Igor Sysoev <igor@sysoev.ru>
parents:
3909
diff
changeset
|
131 #define ngx_debug_init() |
1b779cb69dc8
malloc() debugging on MacOSX.
Igor Sysoev <igor@sysoev.ru>
parents:
3909
diff
changeset
|
132 |
1377
0d57c150115b
set default listen() backlog to 511 on all platforms except FreeBSD
Igor Sysoev <igor@sysoev.ru>
parents:
727
diff
changeset
|
133 |
455 | 134 #if (__FreeBSD__) && (__FreeBSD_version < 400017) |
135 | |
136 #include <sys/param.h> /* ALIGN() */ | |
137 | |
2006
b52cb9bf2064
style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents:
1954
diff
changeset
|
138 /* |
1901
d880fa02fb65
use CMSG_LEN(), this fixes an alert "sendmsg() failed (9: Bad file descriptor)"
Igor Sysoev <igor@sysoev.ru>
parents:
1581
diff
changeset
|
139 * FreeBSD 3.x has no CMSG_SPACE() and CMSG_LEN() and has the broken CMSG_DATA() |
d880fa02fb65
use CMSG_LEN(), this fixes an alert "sendmsg() failed (9: Bad file descriptor)"
Igor Sysoev <igor@sysoev.ru>
parents:
1581
diff
changeset
|
140 */ |
455 | 141 |
142 #undef CMSG_SPACE | |
143 #define CMSG_SPACE(l) (ALIGN(sizeof(struct cmsghdr)) + ALIGN(l)) | |
144 | |
1901
d880fa02fb65
use CMSG_LEN(), this fixes an alert "sendmsg() failed (9: Bad file descriptor)"
Igor Sysoev <igor@sysoev.ru>
parents:
1581
diff
changeset
|
145 #undef CMSG_LEN |
d880fa02fb65
use CMSG_LEN(), this fixes an alert "sendmsg() failed (9: Bad file descriptor)"
Igor Sysoev <igor@sysoev.ru>
parents:
1581
diff
changeset
|
146 #define CMSG_LEN(l) (ALIGN(sizeof(struct cmsghdr)) + (l)) |
d880fa02fb65
use CMSG_LEN(), this fixes an alert "sendmsg() failed (9: Bad file descriptor)"
Igor Sysoev <igor@sysoev.ru>
parents:
1581
diff
changeset
|
147 |
455 | 148 #undef CMSG_DATA |
149 #define CMSG_DATA(cmsg) ((u_char *)(cmsg) + ALIGN(sizeof(struct cmsghdr))) | |
150 | |
151 #endif | |
152 | |
153 | |
601 | 154 extern char **environ; |
155 | |
156 | |
355
0fb6c53fb135
nginx-0.0.7-2004-06-15-21:47:16 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
157 #endif /* _NGX_POSIX_CONFIG_H_INCLUDED_ */ |