Date: Sun, 14 Jul 2002 22:56:53 +0200 From: Thomas Moestl <tmoestl@gmx.net> To: Luigi Rizzo <luigi@freebsd.org> Cc: current@freebsd.org Subject: Re: different packing of structs in kernel vs. userland ? Message-ID: <20020714205653.GE314@crow.dom2ip.de> In-Reply-To: <20020714134337.A78891@iguana.icir.org> References: <20020714011810.A72236@iguana.icir.org> <20020714203642.GD314@crow.dom2ip.de> <20020714134337.A78891@iguana.icir.org>
next in thread | previous in thread | raw e-mail | index | archive | help
On Sun, 2002/07/14 at 13:43:37 -0700, Luigi Rizzo wrote: > [i am deliberately not trimming the email in case someone wants to > look at the context] > > i am a bit dubious about your explaination -- it also does not > explain why the person reporting this problem "fixed" that > by swapping "timestamp" and "next_rule" in the structure It does - doing so removes the need for padding before 'next_rule', because it is properly aligned then. 'timestamp' and 'cmd' are both 4 bytes in size and immediately follow each other, so the total structure size is a multiple of 8 (48 bytes). Because of that, no padding after 'cmd' is required, and the effect is gone. - thomas -- Thomas Moestl <tmoestl@gmx.net> http://www.tu-bs.de/~y0015675/ <tmm@FreeBSD.org> http://people.FreeBSD.org/~tmm/ PGP fingerprint: 1C97 A604 2BD0 E492 51D0 9C0F 1FE6 4F1D 419C 776C To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20020714205653.GE314>