Pointers ... very tough to figger out. From the man page:
int getaddrinfo(const char *node,
const char *service,
const struct addrinfo *hints,
struct addrinfo **res);
Your first and second args are pointer to char. Correct.
Your &hints looks correct. The function wants a pointer
and you supplied the address of the struct (a pointer by nature).
Your &res also looks correct, the address of a pointer (and the
function wants a pointer to a pointer). But in both cases the syntax
has gotten messy enough that one's eyes start to hurt.
Avoid eye pain.
Try
struct addrinfo *hintp, **resp;
...
hintp = &hints;
resp = &res0;
error = getaddrinfo(name, port, hintp, resp);
It might also help to eyeball the headers
to know exactly what the environment vendor is trying to wrap.
ONCE YOU GET PAST THIS PROBLEM,
re-run your compilations on at least one other platform.
(Maybe Linux or CYGWIN. Try Solaris if you have it.
AIX should prove particularly demanding.)
Once upon a time, people used 'lint' to remove bits of fluff
from their C sources. Remember: C is like Assembler in that it
gets down and dirty.
-- R;