Date: Wed, 29 May 2002 08:04:50 +0200 From: Poul-Henning Kamp <phk@critter.freebsd.dk> To: Marcel Moolenaar <marcel@xcllnt.net> Cc: cvs-committers@FreeBSD.ORG, cvs-all@FreeBSD.ORG Subject: Re: cvs commit: src/sys/sys gpt.h Message-ID: <10217.1022652290@critter.freebsd.dk> In-Reply-To: Your message of "Tue, 28 May 2002 22:36:53 PDT." <20020529053653.GA306@dhcp01.pn.xcllnt.net>
next in thread | previous in thread | raw e-mail | index | archive | help
In message <20020529053653.GA306@dhcp01.pn.xcllnt.net>, Marcel Moolenaar writes : >On Wed, May 29, 2002 at 07:09:21AM +0200, Poul-Henning Kamp wrote: >> In message <200205290258.g4T2wgF83137@freefall.freebsd.org>, Marcel Moolenaar w >> rites: >> >marcel 2002/05/28 19:58:41 PDT >> > >> > Modified files: >> > sys/sys gpt.h >> > Log: >> > Add attribute packed to struct gpt_hdr to avoid unwanted padding at >> > the end of the struct to make it an integral number of "longs" on >> > 64-bit architectures. The size of the struct must be 92, not 96. >> >> I think the correct thing to do would be to add a pack/unpack function >> like it is already done in geom_bsd, geom_sun and geom_mbr. That way >> the alignment and wordsize of the local platform doesn't matter. > >I see what you mean, but packing and unpacking is not the problem. It's >sizeof() that's got it wrong. I don't quite understand why sizeof() >would yield a size that's 4 bytes longer than the structure actually >is. It smells like a gcc bug, but I assume for now I'm just missing >something. If you do the packing & unpacking the sizeof doesn't matter... >BTW: the dump of the GPT headers have the wrong size. I can make a new >dump if you want, but you can also change the 12th byte in the GPT >header sectors from 0x60 to 0x5c. I havn't had a second to look at it yet (but Thanks!) -- Poul-Henning Kamp | UNIX since Zilog Zeus 3.20 phk@FreeBSD.ORG | TCP/IP since RFC 956 FreeBSD committer | BSD since 4.3-tahoe Never attribute to malice what can adequately be explained by incompetence. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe cvs-all" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?10217.1022652290>