--- a/c.h	2013-04-30 04:30:28.000000000 -0700
+++ b/c.h	2014-03-28 16:54:15.000000000 -0700
@@ -244,11 +244,13 @@ static inline int dirfd(DIR *d)
  */
 static inline size_t get_hostname_max(void)
 {
+#ifdef _SC_HOST_NAME_MAX
 	long len = sysconf(_SC_HOST_NAME_MAX);
 
 	if (0 < len)
 		return len;
+#endif
 
 #ifdef MAXHOSTNAMELEN
 	return MAXHOSTNAMELEN;
 #elif HOST_NAME_MAX
