"David B. Rees" <[EMAIL PROTECTED]> asks:
> I recently upgraded to glibc-2.1.1pre2 from glibc-2.1.1pre1, and found that
> doing a gethostbyname on IP addresses now fails.  For instance, the following
> code returns NULL on a glibc-2.1.1pre2 machine, and the same binary works fine
> on another non-glibc-2.1.1pre2 machine:

  You are misusing the   gethostbyname()  misbehaviour at some versions
of the glibc-2.0.  Per specification doing mapping from IPv4 address to
hostent structures, you should use:  inet_aton()  (or  inet_pton() for
newer systems)

> if ((ht = gethostbyname("127.0.0.1")) == NULL) {
>     printf("Error: %d ", h_errno);
> else
>     printf("Fine and dandy\n");
.... 
> -Dave

/Matti Aarnio <[EMAIL PROTECTED]>

Reply via email to