aishuishou
aishuishou

Reputation: 83

where is the function inet_ntoa really defined?

I see this following line in /usr/include/arpa/inet.h:

extern char *inet_ntoa (struct in_addr __in) __THROW;

but where is it really defined?

Upvotes: 0

Views: 688

Answers (2)

Michael Aaron Safyan
Michael Aaron Safyan

Reputation: 95449

The system headers merely declare the interface for invoking functions provided by the system. The actual implementation will be compiled into a (typically shared) library on the system. On some systems, the actual implementation is unavailable in source code form and proprietary. Fortunately, on GNU/Linux, FreeBSD, and Mac OS X, one can actually find the original implementation of inet_ntoa.

For GNU/Linux, it the implementation is part of the GNU C Library (glibc).

Upvotes: 5

Metalartis
Metalartis

Reputation: 115

It has been compiled and exists in Ws2_32.lib.

You could see what is a Library

Upvotes: 0

Related Questions