Index: head/lib/libnv/msgio.c =================================================================== --- head/lib/libnv/msgio.c +++ head/lib/libnv/msgio.c @@ -63,7 +63,13 @@ /* Linux: arbitrary size, but must be lower than SCM_MAX_FD. */ #define PKG_MAX_SIZE ((64U - 1) * CMSG_SPACE(sizeof(int))) #else -#define PKG_MAX_SIZE (MCLBYTES / CMSG_SPACE(sizeof(int)) - 1) +/* + * To work around limitations in 32-bit emulation on 64-bit kernels, use a + * machine-independent limit on the number of FDs per message. Each control + * message contains 1 FD and requires 12 bytes for the header, 4 pad bytes, + * 4 bytes for the descriptor, and another 4 pad bytes. + */ +#define PKG_MAX_SIZE (MCLBYTES / 24) #endif static int