bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: declare sethostname if unistd.h doesn't


From: Simon Josefsson
Subject: Re: declare sethostname if unistd.h doesn't
Date: Mon, 21 Nov 2011 11:00:04 +0100
User-agent: Gnus/5.110018 (No Gnus v0.18) Emacs/23.2 (gnu/linux)

Ben Walton <address@hidden> writes:

> Excerpts from Simon Josefsson's message of Sun Nov 20 14:04:42 -0500 2011:
>
> Hi Simon,
>
>> Have you tested that it resolves the portability issue?  If so that is
>> great.  My man page says Solaris uses this prototype:
>> 
>>      int sethostname(char *name, int namelen);
>
> I used a modified version of the patch to compile inetutils and got
> to the logprio.h issue, which was past the sethostname issue.
>
>> however possibly int and size_t have the same size on all Solaris 8 and
>> 9 architectures?
>
> You're right that this should be int though.  That's what the solaris
> man page indicates...I grabbed the prototype from the wrong terminal
> it would seem.

My point was that the POSIX prototype uses size_t and Solaris seems to
use int, and as Paul pointed out, on 64-bit Solaris systems just
providing the prototype will break -- there needs to be a wrapper
function or a #define that casts the second parameter, or something
similar.  The POSIX prototype has const as well, so you would get
warnings passing a const string to the Solaris function if there is no
casting or wrapper function.

>> In any case, I support installing this if it does something useful
>> on at least some (Solaris) machine, since the current situation does
>> not appear to work on any (Solaris) machine.
>
> It could be a local modification of the inetutils gnulib code until
> the proper version is implemented?

Sure -- I believe we also agreed that the inetutils hostname tool should
still build if sethostname is missing, just without that functionality.
There needs to be some changes for that as well.

/Simon



reply via email to

[Prev in Thread] Current Thread [Next in Thread]