mac doesn't have gethostbyname_r() and getservbyname_r()