Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 19 Aug 2003 17:32:49 -0400 (EDT)
From:      Garrett Wollman <wollman@khavrinen.lcs.mit.edu>
To:        Marcel Moolenaar <marcel@xcllnt.net>
Cc:        cvs-all@FreeBSD.org
Subject:   Re: cvs commit: src/include unistd.h
Message-ID:  <200308192132.h7JLWnZk035752@khavrinen.lcs.mit.edu>
In-Reply-To: <20030819210421.GA28597@athlon.pn.xcllnt.net>
References:  <200308192039.h7JKdni9081097@repoman.freebsd.org> <20030819210421.GA28597@athlon.pn.xcllnt.net>

next in thread | previous in thread | raw e-mail | index | archive | help
<<On Tue, 19 Aug 2003 14:04:21 -0700, Marcel Moolenaar <marcel@xcllnt.net> said:

> Changing the type of the namelen argument from int to size_t in
> at least the implementation of the function breaks the ABI on
> 64-bit platforms. The problem is that sign-extension is moved
> from the callee to the caller and previously compiled code will
> not have said sign-extension.

Hmmm.  I hadn't thought of that, but you're absolutely right.
Suggestions as to the best way to deal?  (I want the type to be
correct going forward.)

It wouldn't be too hard to support both, at least in the short run.
It would look like this in the header file:

int	gethostname(char *, int);
int	__gethostname(char *, size_t);
#define	gethostname __gethostname

...and then there would be trampoline in libc that took care of the
rest.

-GAWollman



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200308192132.h7JLWnZk035752>