diff --git a/configure.in b/configure.in index 797cc3b19..a875edcf9 100644 --- a/configure.in +++ b/configure.in @@ -734,10 +734,12 @@ AC_CHECK_FUNCS([DINFINITY DQNAN cexp chsize clog clog10 ctermid fesetround ftime # declaration is only found if `_BSD' is defined; it's marked as # discouraged in and has type `void' instead of `int' # anyway. +# hstrerror - on Tru64 5.1b the symbol is available in libc but the +# declaration isn't anywhere. # AC_CHECK_HEADERS(crypt.h netdb.h pthread.h sys/param.h sys/resource.h sys/file.h) AC_CHECK_FUNCS(chroot flock getlogin cuserid getpriority setpriority getpass sethostname gethostname) -AC_CHECK_DECLS([sethostname, strncasecmp, unsetenv]) +AC_CHECK_DECLS([sethostname, strncasecmp, unsetenv, hstrerror]) # crypt() may or may not be available, for instance in some countries there # are restrictions on cryptography. diff --git a/libguile/net_db.c b/libguile/net_db.c index deb8d381d..af6e3d5f4 100644 --- a/libguile/net_db.c +++ b/libguile/net_db.c @@ -1,5 +1,5 @@ /* "net_db.c" network database support - * Copyright (C) 1995,1996,1997,1998,1999,2000,2001, 2006 Free Software Foundation, Inc. + * Copyright (C) 1995,1996,1997,1998,1999,2000,2001, 2006, 2009 Free Software Foundation, Inc. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -64,6 +64,12 @@ extern int h_errno; #endif +#if defined HAVE_HSTRERROR && !HAVE_DECL_HSTRERROR \ + && !defined __MINGW32__ && !defined __CYGWIN__ +/* Some OSes, such as Tru64 5.1b, lack a declaration for hstrerror(3). */ +extern const char *hstrerror (int); +#endif + SCM_SYMBOL (scm_host_not_found_key, "host-not-found");