Basically Dilos is 64-bit userland and SmartOS is 32-bit.
We need code to fit both, this seems to work.
#ifndef RT_ROUNDUP
#define RT_ROUNDUP(a) \
- ((a) > 0 ? (1 + (((a) - 1) | (sizeof(long) - 1))) : sizeof(long))
+ ((a) > 0 ? (1 + (((a) - 1) | (sizeof(int32_t) - 1))) : sizeof(int32_t))
+#define RT_ADVANCE(x, n) ((x) += RT_ROUNDUP(salen((n))))
#endif
#define COPYOUT(sin, sa) do { \
sap = &sa[i];
if (type & (1 << i)) {
*sap = (const struct sockaddr *)cp;
- cp += salen(*sap);
+ RT_ADVANCE(cp, *sap);
} else
*sap = NULL;
}