[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: mig hack (was: Re: nss is broken
From: |
Marcus Brinkmann |
Subject: |
Re: mig hack (was: Re: nss is broken |
Date: |
Wed, 31 Jul 2002 04:53:57 +0200 |
User-agent: |
Mutt/1.4i |
On Tue, Jul 30, 2002 at 07:40:06PM -0700, Thomas Bushnell, BSG wrote:
> > 2002-07-31 Marcus Brinkmann <marcus@gnu.org>
> >
> > * routine.c (rtFindSize): Always add sizeof_mach_msg_type_t to
> > SIZE for args not in long form, irregardless of the itSize.
>
> I fear that this fixes that case, but runs the risk of breaking the
> case of passing shorts and chars when alignment might matter.
sizeof_mach_msg_type_t is 4 on x86 (and probably at least four on every
other machine we ever will care about). itSize/8 will only be added if it
is larger than this value 4, that means that it does always add at least 4.
If you have a short or a byte, 4 will be added anyway. Alignment is done by
padding, if I understood it correctly, and padding is added elsewhere in
type.c:
static void
itCalculateSizeInfo(register ipc_type_t *it)
{
if (it->itInLine)
{
u_int bytes = (it->itNumber * it->itSize + 7) / 8;
u_int padding = (4 - bytes%4)%4;
it->itTypeSize = bytes;
it->itPadSize = padding;
...
Am I confused?
Thanks,
Marcus
--
`Rhubarb is no Egyptian god.' GNU http://www.gnu.org marcus@gnu.org
Marcus Brinkmann The Hurd http://www.gnu.org/software/hurd/
Marcus.Brinkmann@ruhr-uni-bochum.de
http://www.marcus-brinkmann.de/
- nss is broken, Marcus Brinkmann, 2002/07/30
- mig hack (was: Re: nss is broken, Marcus Brinkmann, 2002/07/30
- Re: nss is broken, Marcus Brinkmann, 2002/07/31
- Re: nss is broken, Marcus Brinkmann, 2002/07/31
- Re: nss is broken, Roland McGrath, 2002/07/31
- Re: nss is broken, Roland McGrath, 2002/07/31
- Re: nss is broken, Roland McGrath, 2002/07/31
- Re: nss is broken, Marcus Brinkmann, 2002/07/31
- Re: nss is broken, Roland McGrath, 2002/07/31