if (!ret) {
char hostname[200];
strcpy(hostname, "unknown");
+#if HAVE_GETHOSTNAME
gethostname(hostname, sizeof(hostname)-1);
+#endif
hostname[sizeof(hostname)-1] = 0;
asprintf(&ret, "%s.%u", hostname, (unsigned)getpid());
}
*/
#undef HAVE_DIRENT_H
+/* Define to 1 if you have the `gethostname' function. */
+#undef HAVE_GETHOSTNAME
+
/* Define to 1 if you have the <inttypes.h> header file. */
#undef HAVE_INTTYPES_H
-for ac_func in realpath snprintf vsnprintf vasprintf asprintf mkstemp
+
+for ac_func in realpath snprintf vsnprintf vasprintf asprintf mkstemp gethostname
do
as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
echo "$as_me:$LINENO: checking for $ac_func" >&5
AC_CHECK_HEADERS(ctype.h strings.h stdlib.h string.h)
-AC_CHECK_FUNCS(realpath snprintf vsnprintf vasprintf asprintf mkstemp)
+AC_CHECK_FUNCS(realpath snprintf vsnprintf vasprintf asprintf mkstemp gethostname)
AC_CACHE_CHECK([for compar_fn_t in stdlib.h],ccache_cv_COMPAR_FN_T, [
AC_TRY_COMPILE(