summaryrefslogtreecommitdiffhomepage
path: root/src/os/unix/ngx_posix_config.h
diff options
context:
space:
mode:
authorIgor Sysoev <igor@sysoev.ru>2008-07-07 11:58:55 +0000
committerIgor Sysoev <igor@sysoev.ru>2008-07-07 11:58:55 +0000
commit4012d9909c4f15c5aa6b1feedcb1abfbb7575dc3 (patch)
tree18035f264bf5dce4b7c9521c19418441ead3defd /src/os/unix/ngx_posix_config.h
parent22a5d849701071c13f6a566ab640f8088f72c58e (diff)
downloadnginx-4012d9909c4f15c5aa6b1feedcb1abfbb7575dc3.tar.gz
nginx-4012d9909c4f15c5aa6b1feedcb1abfbb7575dc3.tar.bz2
r1901, r1902, r2032 merge:
bugfixes in channel: *) avoid endless loop if epoll is used *) use CMSG_LEN(), this fixes an alert "sendmsg() failed (9: Bad file descriptor)" on some 64-bit platforms *) read channel until EAGAIN
Diffstat (limited to 'src/os/unix/ngx_posix_config.h')
-rw-r--r--src/os/unix/ngx_posix_config.h7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/os/unix/ngx_posix_config.h b/src/os/unix/ngx_posix_config.h
index 49c3c4d6c..37176e0d2 100644
--- a/src/os/unix/ngx_posix_config.h
+++ b/src/os/unix/ngx_posix_config.h
@@ -110,11 +110,16 @@
#include <sys/param.h> /* ALIGN() */
-/* FreeBSD 3.x has no CMSG_SPACE() at all and has the broken CMSG_DATA() */
+/*
+ * FreeBSD 3.x has no CMSG_SPACE() and CMSG_LEN() and has the broken CMSG_DATA()
+ */
#undef CMSG_SPACE
#define CMSG_SPACE(l) (ALIGN(sizeof(struct cmsghdr)) + ALIGN(l))
+#undef CMSG_LEN
+#define CMSG_LEN(l) (ALIGN(sizeof(struct cmsghdr)) + (l))
+
#undef CMSG_DATA
#define CMSG_DATA(cmsg) ((u_char *)(cmsg) + ALIGN(sizeof(struct cmsghdr)))