Alignment fixups for gethostbyname_r

Daniel Jacobowitz drow at false.org
Sat Dec 22 16:51:56 UTC 2007


On Sat, Dec 22, 2007 at 07:35:10AM +0100, Carmelo Amoroso wrote:
> Hi Daniel,
> I've merged it into my sh4-nptl branch to do some tests,
> but not possible until Jan 3rd.
> The patch is surely ok, but, the caller of the gethostbyname is the
> real cause of the error, that could happen in some other part,
> being the passed buffer unaligned.

The buffer is a char *; nothing in the standard requires it to be
aligned.

I found a testcase in my notes:

#include <unistd.h>

int main()
{

        long foo;
        foo = gethostid();
}

It may depend on what's in your /etc/hosts though.

-- 
Daniel Jacobowitz
CodeSourcery



More information about the uClibc mailing list