3 dnl Copyright (C) 2011-2024 Free Software Foundation, Inc.
4 dnl This file is free software; the Free Software Foundation
5 dnl gives unlimited permission to copy and/or distribute it,
6 dnl with or without modifications, as long as this notice is preserved.
9 # - the sethostname() function,
10 # - the HOST_NAME_MAX macro in <limits.h>.
11 AC_DEFUN([gl_FUNC_SETHOSTNAME],
13 AC_REQUIRE([gl_UNISTD_H_DEFAULTS])
15 gl_PREREQ_HOST_NAME_MAX
17 gl_CHECK_FUNCS_ANDROID([sethostname], [[#include <unistd.h>]])
18 if test $ac_cv_func_sethostname = no; then
20 case "$gl_cv_onwards_func_sethostname" in
21 future*) REPLACE_SETHOSTNAME=1 ;;
25 AC_CHECK_DECLS([sethostname])
26 if test $ac_cv_have_decl_sethostname = no; then
27 HAVE_DECL_SETHOSTNAME=0