This is the mail archive of the java@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: libjava/net/natInetAddress.cc uses inet_pton, not declared on irix6.2


"Kaveh R. Ghazi" wrote:

> On irix6.2, inet_pton is provided by libc, but is not declared
> anywhere.  (I don't think this afflicts the primary mips eval
> platform, irix6.5, since no one has reported it, but its possible
> other secondary or tertiary platforms have this problem too.)
>
> Anyway, I'd like to solicit comments on how to approach this.
> E.g. provide a backup decl if one isn't found or nuke inet_pton
> altogether?  (I don't think its a standard function.)  Also, I don't
> know exactly what inet_pton does to consider how to avoid its use.
> (E.g. can't find a man page on x86-linux-gnu.)

inet_pton is the IPv6 counterpart/successor to inet_aton. Its use is already
protected with an "#ifdef HAVE_INET_PTON" so I'm not sure why you get the
undefined function error. Since we currently only call it as a backup when
inet_aton fails, it is quite safe to #ifdef it out on platforms without
complete v6 support. I would say that the proper fix is to fix the
HAVE_INET_PTON configure test? Failing that, if HAVE_INET6 is not defined on
this Irix version you could just protect the call with an #ifdef test for
that as well.

>From the glibc docs:

Function: int inet_pton (int af, const char *cp, void *buf)
     This function converts an Internet address (either IPv4 or IPv6) from
presentation (textual) to network (binary) format. af should be either
AF_INET or AF_INET6, as appropriate for the type of address being converted.
cp is a pointer to the input string, and buf is a pointer to a buffer for
the result. It is the caller's responsibility to make sure the buffer is
large enough.

regards

  [ bryce ]



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]