Subject: Re: unaligned access: how to track ?
To: Chris G. Demetriou <cgd@netbsd.org>
From: Manuel Bouyer <bouyer@antioche.lip6.fr>
List: port-alpha
Date: 06/07/2000 18:54:12
On Wed, Jun 07, 2000 at 09:20:39AM -0700, Chris G. Demetriou wrote:
> No, it's not. It's a bug in the code using the db interfaces. To
> quote dbopen(3):
>
> KEY/DATA PAIRS
> Access to all file types is based on key/data pairs. Both
> keys and data are represented by the following data struc-
> ture:
> [ ... ]
> Key and data byte strings may reference strings of essen-
> tially unlimited length although any two of them must fit
> into available memory at the same time. It should be
> noted that the access methods provide no guarantees about
> byte string alignment.
>
> i.e., if you want to access them as structures, it's on you to make
> sure you've put them in a form such that that is safe.
Hum ok, so we should pad the key to the alignement required by the
architecture.
Shouldn't be hard to do in rpc.statd but I need to know the alignement
requirement for the arch we are compiling for. Is there a macro or something
that will give me that info ? Doing "#ifdef __foo_" doesn't look like the
rigth solution.
--
Manuel Bouyer, LIP6, Universite Paris VI. Manuel.Bouyer@lip6.fr
--