From 09248b7a55f660d85e70e9999090063651c99904 Mon Sep 17 00:00:00 2001 From: Igor Sysoev Date: Tue, 19 Feb 2008 16:34:55 +0000 Subject: use CMSG_LEN(), this fixes an alert "sendmsg() failed (9: Bad file descriptor)" on some 64-bit platforms --- src/os/unix/ngx_posix_config.h | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src/os/unix/ngx_posix_config.h') 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 /* 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))) -- cgit