cvs commit: src/include unistd.h

Garrett Wollman wollman at khavrinen.lcs.mit.edu
Tue Aug 19 14:32:53 PDT 2003


<<On Tue, 19 Aug 2003 14:04:21 -0700, Marcel Moolenaar <marcel at 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



More information about the cvs-src mailing list