;; return the FIRST address only
(bind-func host_to_ip
(lambda (name:i8*)
(let ((he (cast (gethostbyname name) hostent*)))
(if (null? he)
(begin (printf "Could not find hostname: %s\n" name)
null)
(let ((addresses (cast (tref he 4) in_addr**)))
(inet_ntoa (tref (pref addresses 0) 0)))))))