Host to IP Source Code in C - Questions! Please Help

Hello,

First of all, i want to say Hi! Glad to join your forum and be your member. I'm a newbie towards C/C++ especially on network programming.

What is the definition of getaddrinfo()?

int getaddrinfo(const char *node, const char *service,
const struct addrinfo *hints,
struct addrinfo **res);

Can you tell me in which library does it reside?

If the library name is not listed in

man getaddrinfo

you can dump the symbol table of libraries to find what you are looking for. In this case, libc shows:

$ nm /lib/libc.so|grep getaddrinfo
00089a30 T _getaddrinfo
00089a30 W getaddrinfo

which tells us getaddrinfo is in the Text section of libc.

On Solaris, it may be in "libsock.so".

and libintl.so as well

thanks