apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jeff Trawick <traw...@attglobal.net>
Subject Re: getaddrinfo() on HP-UX 11i
Date Fri, 20 Feb 2004 09:07:41 GMT
Joe Orton wrote:
> On Thu, Feb 19, 2004 at 01:20:24PM -0500, Jeff Trawick wrote:
> 
>>Can anyone make that thing work well enough for APR's use without the 
>>optional IPv6 networking stack installed?
> 
> 
> But it works well enough that APR_CHECK_WORKING_GETADDRINFO doesn't
> fail?

yep

> What's the simplest thing that fails, getaddrinfo("localhost", ...) 
> even?

localhost lookup works for me; getaddrinfo() for anything in /etc/hosts seems 
to work in fact

The test program is simply:

> #include <stdio.h>
> #include <stdlib.h>
> 
> #include <sys/socket.h>
> #include <netdb.h>
> 
> int main(int argc, char **argv) {
>     int rc;
>     int family;
>     const char *hostname;
>     struct addrinfo hints, *ai_list;
> 
>     if (argc != 3) {
>         exit(1);
>     }
>     family = atoi(argv[1]);
>     hostname = argv[2];
>     memset(&hints, 0, sizeof(hints));
>     hints.ai_family = family;
>     hints.ai_socktype = SOCK_STREAM;
>     rc = getaddrinfo(hostname, NULL, &hints, &ai_list);
>     printf("getaddrinfo()->%d\n", rc);
> 
>     return rc != 0;
> }

but substitute ab (to use getaddrinfo() via apr_sockaddr_info_get()) and I get 
the same results


Mime
View raw message