On Thu, May 22, 2008 at 04:14:46PM +0000, Bjoern A. Zeeb wrote:
> On Thu, 22 May 2008, John Timony wrote:
> 
> Hi,
> 
> >I am writing a c program in FreeBSD,and I can not
> >translate a ip to hostname
> >,i wonder if there is a function to take this job...
> 
> You mean like gethostbyaddr()?
> 
> See also http://www.unixguide.net/network/socketfaq/2.24.shtml for
> further inspiration on this but slightly different topic.

You can also use the newer getaddrinfo(3)/freeaddrinfo(3).
I think it is bit easier to use and can it transparently handle inet6
addresses as well.
The only downside is that some rare old systems don't support it.
On FreeBSD it is suppoorted since FreeBSD-4, but some commerical
OS implemented it later.

-- 
B.Walter <[EMAIL PROTECTED]> http://www.bwct.de
Modbus/TCP Ethernet I/O Baugruppen, ARM basierte FreeBSD Rechner uvm.
_______________________________________________
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to "[EMAIL PROTECTED]"

Reply via email to