1 # fdatasync.m4 serial 5
2 dnl Copyright (C) 2008-2020 Free Software Foundation, Inc.
3 dnl This file is free software; the Free Software Foundation
4 dnl gives unlimited permission to copy and/or distribute it,
5 dnl with or without modifications, as long as this notice is preserved.
7 AC_DEFUN([gl_FUNC_FDATASYNC],
9 AC_REQUIRE([gl_UNISTD_H_DEFAULTS])
10 AC_REQUIRE([AC_CANONICAL_HOST])
12 dnl Using AC_CHECK_FUNCS_ONCE would break our subsequent AC_SEARCH_LIBS
13 AC_CHECK_DECLS_ONCE([fdatasync])
15 AC_SUBST([LIB_FDATASYNC])
17 if test $ac_cv_have_decl_fdatasync = no; then
19 dnl Mac OS X 10.7 has fdatasync but does not declare it.
20 AC_CHECK_FUNCS([fdatasync])
21 if test $ac_cv_func_fdatasync = no; then
27 dnl Solaris <= 2.6 has fdatasync() in libposix4.
28 dnl Solaris 7..10 has it in librt.
30 AC_SEARCH_LIBS([fdatasync], [rt posix4],
31 [test "$ac_cv_search_fdatasync" = "none required" ||
32 LIB_FDATASYNC=$ac_cv_search_fdatasync])
36 dnl Android 4.3 does not have fdatasync but declares it.
37 AC_CHECK_FUNCS([fdatasync])
38 if test $ac_cv_func_fdatasync = no; then