Re: [releng_6 tinderbox] failure on sparc64/sparc64
- From: Peter Jeremy <peterjeremy@xxxxxxxxxxxxxxxx>
- Date: Mon, 13 Feb 2006 20:38:34 +1100
On Mon, 2006-Feb-13 10:48:02 +0200, Giorgos Keramidas wrote:
Good thinking. It's probably a good idea to avoid copying random
garbage, and using something like:
struct foo foo;
uint32_t value[sizeof(uint32_t) * (sizeof(foo) / sizeof(uint32_t) + 1)];
That makes it about 4 times too large - you don't need to multiply by
sizeof(uint32_t).
and then copying only sizeof(foo) bytes.
And zeroing any remaining bytes to prevent uninitialised data leaking out
of the kernel.
and won't allow overflowing of value[], but I don't really want to know
what it does on machines of varying endianess :-)
No worse than trying to write (uint32_t *)&foo;
BTW, the compiler is free to insert padding bytes into struct foo so
it would need to be explicitly zeroed and then the required fields
individually copied in.
--
Peter Jeremy
_______________________________________________
freebsd-arch@xxxxxxxxxxx mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-arch
To unsubscribe, send any mail to "freebsd-arch-unsubscribe@xxxxxxxxxxx"
- Follow-Ups:
- Re: [releng_6 tinderbox] failure on sparc64/sparc64
- From: Giorgos Keramidas
- Re: [releng_6 tinderbox] failure on sparc64/sparc64
- References:
- Re: [releng_6 tinderbox] failure on sparc64/sparc64
- From: Stefan Farfeleder
- Re: [releng_6 tinderbox] failure on sparc64/sparc64
- From: Dag-Erling Smørgrav
- Re: [releng_6 tinderbox] failure on sparc64/sparc64
- From: Erik Trulsson
- Re: [releng_6 tinderbox] failure on sparc64/sparc64
- From: M. Warner Losh
- Re: [releng_6 tinderbox] failure on sparc64/sparc64
- From: Giorgos Keramidas
- Re: [releng_6 tinderbox] failure on sparc64/sparc64
- From: Colin Percival
- Re: [releng_6 tinderbox] failure on sparc64/sparc64
- From: Giorgos Keramidas
- Re: [releng_6 tinderbox] failure on sparc64/sparc64
- Prev by Date: Re: NTFS write support
- Next by Date: Re: [releng_6 tinderbox] failure on sparc64/sparc64
- Previous by thread: Re: [releng_6 tinderbox] failure on sparc64/sparc64
- Next by thread: Re: [releng_6 tinderbox] failure on sparc64/sparc64
- Index(es):