From a6d20bbaa2f4bb3684d2c396ef1f1411c8fb8499 Mon Sep 17 00:00:00 2001 From: Juli Mallett Date: Sat, 3 Mar 2012 21:39:12 +0000 Subject: [PATCH] On MIPS, _ALIGN always aligns to 8 bytes, even for 32-bit binaries. This might not be ideal, but is the ABI we've shipped so far. Fix macros which reflect the results of _ALIGN on 32-bit MIPS to use the right alignment. This fixes sendmsg under COMPAT_FREEBSD32 on n64 MIPS kernels. --- sys/compat/freebsd32/freebsd32_misc.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sys/compat/freebsd32/freebsd32_misc.c b/sys/compat/freebsd32/freebsd32_misc.c index 3938e99ef036..81568ae19e5c 100644 --- a/sys/compat/freebsd32/freebsd32_misc.c +++ b/sys/compat/freebsd32/freebsd32_misc.c @@ -952,7 +952,11 @@ freebsd32_copyoutmsghdr(struct msghdr *msg, struct msghdr32 *msg32) return (error); } +#ifndef __mips__ #define FREEBSD32_ALIGNBYTES (sizeof(int) - 1) +#else +#define FREEBSD32_ALIGNBYTES (sizeof(long) - 1) +#endif #define FREEBSD32_ALIGN(p) \ (((u_long)(p) + FREEBSD32_ALIGNBYTES) & ~FREEBSD32_ALIGNBYTES) #define FREEBSD32_CMSG_SPACE(l) \