Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: Compile problem on AIX 3



Oliver Kiddle wrote:
>inet_aton cannot be resolved (AIX 3.2.5 but not 4.2). This is due to
>changes from 8764 (IPv6 support in zftp). inet_ntoa does exist so there
>isn't a problem with that.

*sigh*

inet_aton() converts an IPv4 address from text to binary form, and
inet_ntoa() does the reverse.  inet_pton() and inet_ntop() are the
newer, preferred, interfaces, which support IPv6 as well as IPv4.
The problem here is that inet_aton() didn't alway exist -- there is an
older inet_addr(), which does the same job, but has a flawed interface.
zftp used to use inet_addr(), but I changed it to use inet_pton(); of
course, inet_pton() doesn't exist everywhere, so I wrote an IPv4-only
version for IPv4-only systems.  (I prefer this approach to multiple
possible interfaces, to avoid cluttering the main code with conditionals.)
In writing this inet_pton(), it never occurred to me that there would
be systems without inet_aton().

>                           I suspect that the correct fix would be to do
>a configure test for inet_aton and have the inet_pton function return -1
>if inet_aton doesn't exist

No.  We ned the functionality of inet_aton().  This can be done either
by implementing inet_aton() manually, or by defining it as a wrapper
for inet_addr().  Patch to follow.

-zefram



Messages sorted by: Reverse Date, Date, Thread, Author