aboutsummaryrefslogtreecommitdiff
path: root/src/os/unix/ngx_freebsd_config.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/os/unix/ngx_freebsd_config.h')
-rw-r--r--src/os/unix/ngx_freebsd_config.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/os/unix/ngx_freebsd_config.h b/src/os/unix/ngx_freebsd_config.h
index ce77ab938..570eee89b 100644
--- a/src/os/unix/ngx_freebsd_config.h
+++ b/src/os/unix/ngx_freebsd_config.h
@@ -35,6 +35,22 @@
#include <sys/sysctl.h>
#include <netinet/tcp.h> /* TCP_NOPUSH */
+
+#if __FreeBSD_version < 400017
+
+#include <sys/param.h> /* ALIGN() */
+
+/* FreeBSD 3.x has no CMSG_SPACE() at all and has the broken CMSG_DATA() */
+
+#undef CMSG_SPACE
+#define CMSG_SPACE(l) (ALIGN(sizeof(struct cmsghdr)) + ALIGN(l))
+
+#undef CMSG_DATA
+#define CMSG_DATA(cmsg) ((u_char *)(cmsg) + ALIGN(sizeof(struct cmsghdr)))
+
+#endif
+
+
#include <ngx_auto_config.h>