1 # fdatasync.m4 serial 4
2 dnl Copyright (C) 2008-2013 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])
11 dnl Using AC_CHECK_FUNCS_ONCE would break our subsequent AC_SEARCH_LIBS
12 AC_CHECK_DECLS_ONCE([fdatasync])
14 AC_SUBST([LIB_FDATASYNC])
16 if test $ac_cv_have_decl_fdatasync = no; then
18 dnl Mac OS X 10.7 has fdatasync but does not declare it.
19 AC_CHECK_FUNCS([fdatasync])
20 if test $ac_cv_func_fdatasync = no; then
24 dnl Solaris <= 2.6 has fdatasync() in libposix4.
25 dnl Solaris 7..10 has it in librt.
27 AC_SEARCH_LIBS([fdatasync], [rt posix4],
28 [test "$ac_cv_search_fdatasync" = "none required" ||
29 LIB_FDATASYNC=$ac_cv_search_fdatasync])