On 13/12/2022 09:45, Kevin Brodsky wrote:
Change it to an unsigned long. Musl uses the same type for its struct definitions.
I've just looked at the definition of struct sockaddr_storage in Musl and it is not in fact using this trick (probably because compat is not a concern there), the __align unsigned long at the end is not actually aligning anything (it's a struct, not a union). Or am I missing something?
I'm not sure what you mean. Without the __ss_align unsigned long, the alignment of the whole struct would be 2. With it, the alignment is 8 (or 4 on 32-bit). I thought that whether it is a struct or union doesn't matter, the same rules apply (I think the kernel just uses a union to make it clear that the size of __data is 126, to not factor in the size of __align). Am I missing something?
Thanks, Kristina