gnulib/lib/gethostname.c says: #ifdef HAVE_UNAME # include <sys/utsname.h> #endif
1. why aren't you testing for HAVE_SYS_UTSNAME_H instead?2. are there really systems without uname & <sys/utsname.h>, given that these are in posix? http://www.opengroup.org/onlinepubs/009695399/functions/uname.html