when MAXPATH is not available, like on hurd platform.
Thanks Marc Dequènes.
dnl for each function found we get a definition in config.h
dnl of the form HAVE_FUNCTION
-AC_CHECK_FUNCS(nl_langinfo tzset fsync mbstowcs opendir readdir chdir chroot getgid getuid setgid setuid strndup strerror snprintf vsnprintf vasprintf fpclass class fp_class isnan memmove strchr mktime getrusage gettimeofday getpwnam getgrnam)
+AC_CHECK_FUNCS(nl_langinfo tzset fsync mbstowcs opendir readdir chdir chroot getgid getuid setgid setuid strndup strerror snprintf vsnprintf vasprintf fpclass class fp_class isnan memmove strchr mktime getrusage gettimeofday getpwnam getgrnam get_current_dir_name)
AC_FUNC_STRERROR_R
printf("ERROR: invalid parameter count for pwd\n");
return (1);
}
+#ifdef MAXPATH
cwd = getcwd(NULL, MAXPATH);
+#elif defined(HAVE_GET_CURRENT_DIR_NAME)
+ cwd = get_current_dir_name();
+#else
+#error "You must have either MAXPATH or get_current_dir_name()"
+#endif
if (cwd == NULL) {
printf("ERROR: getcwd %s\n", rrd_strerror(errno));
return (1);