--- src/connect/ei_resolve_old.c	Mon Nov  6 13:53:29 2006
+++ src/connect/ei_resolve.c	Wed Apr 18 10:30:56 2007
@@ -614,7 +614,7 @@
 #ifndef HAVE_GETHOSTBYNAME_R
   return my_gethostbyname_r(name,hostp,buffer,buflen,h_errnop);
 #else
-#ifdef __GLIBC__
+#if defined(__GLIBC__) || defined(__FreeBSD__)
   struct hostent *result;
 
   gethostbyname_r(name, hostp, buffer, buflen, &result, h_errnop);
