Re: weird padding in linux/timex.h, struct timex

From: Alan Cox (alan@lxorguk.ukuu.org.uk)
Date: Tue Aug 06 2002 - 08:36:04 EST


On Tue, 2002-08-06 at 12:15, Muli Ben-Yehuda wrote:
> Hi,
>
> struct timex in include/linux/timex.h is defined as
>
> struct timex
> {
> ...
> int :32; int :32; int :32; int :32;
> int :32; int :32; int :32; int :32;
> int :32; int :32; int :32; int :32;
> };
>
> I assume that this is used as padding. Is there any reason for using
> bitfields as padding? If there is, a comment to that effect would be
> nice. If there isn't, the following patch makes the padding explicit.
>

That is how the interface has always been defined. I think we inherited
that from the world of xntpd but I may be wrong. Your __pad is not
always the same thing - you assume 4 byte ints and ints aligned the same
way as char [], which may not always be true.

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Wed Aug 07 2002 - 22:00:31 EST