doc: Add documentation about math_errhandling.
[gnulib.git] / m4 / sethostname.m4
blob2769ae5a0c6a870c6f8500d3e3614921f8bc05ff
1 # sethostname.m4
2 # serial 3
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.
8 # Ensure
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
19     HAVE_SETHOSTNAME=0
20     case "$gl_cv_onwards_func_sethostname" in
21       future*) REPLACE_SETHOSTNAME=1 ;;
22     esac
23   fi
25   AC_CHECK_DECLS([sethostname])
26   if test $ac_cv_have_decl_sethostname = no; then
27     HAVE_DECL_SETHOSTNAME=0
28   fi