tech-net archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: routing socket rouding?

On Feb 17, 2012, at 9:20 PM, Mouse wrote:
> There is a macro, historically ROUNDUP defined in various .c files,
> RT_ROUNDUP in <net/route.h> in 5.1 and presumably later, which appears
> to be designed around the undocumented (even in comments) assumption
> that sizeof(long) is a power of two.
> So, I'm curious: does anyone know what this macro turned into on a
> system with sizeof(long) not a power of two but with anything like the
> BSD routing socket, if such a system exists?

ROUNDUP (or ROUND_UP) macro was replaced by ALIGN on some platforms, ie:

There are buggy variants of it which don't work right even on LP64 platforms,
and it appears to assume 2's compliment arithmetic....


Home | Main Index | Thread Index | Old Index