Skip to content

Adds a more comprehensive check for fdatasync #42

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 9, 2015
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 20 additions & 1 deletion configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,26 @@ AC_CHECK_FUNCS([lutimes futimes])
AC_CHECK_FUNCS([mkstemps mkdtemp])

# Functions for file synchronization and allocation control
AC_CHECK_FUNCS([fsync fdatasync])
AC_CHECK_FUNCS([fsync])

# A more comprehensive check that fdatasync exits
# Necessary for platforms that have fdatasync in headers but have no
# implementation
dnl Originally provided by user copiousfreetime for the beanstalkd project
dnl {{{ make sure that fdatasync exits
AC_CACHE_CHECK([for fdatasync],[ac_cv_func_fdatasync],[
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
#include <unistd.h>
]],[[
fdatasync(4);
]])],
[ac_cv_func_fdatasync=yes],
[ac_cv_func_fdatasync=no])
])
AS_IF([test "x${ac_cv_func_fdatasync}" = "xyes"],
[AC_DEFINE([HAVE_FDATASYNC],[1],[If the system defines fdatasync])])
dnl }}}

AC_CHECK_FUNCS([posix_fadvise posix_fallocate])

# Avoid adding rt if absent or unneeded
Expand Down