File tree Expand file tree Collapse file tree 1 file changed +20
-1
lines changed
Expand file tree Collapse file tree 1 file changed +20
-1
lines changed Original file line number Diff line number Diff line change @@ -68,7 +68,26 @@ AC_CHECK_FUNCS([lutimes futimes])
6868AC_CHECK_FUNCS ( [ mkstemps mkdtemp] )
6969
7070# Functions for file synchronization and allocation control
71- AC_CHECK_FUNCS ( [ fsync fdatasync] )
71+ AC_CHECK_FUNCS ( [ fsync] )
72+
73+ # A more comprehensive check that fdatasync exits
74+ # Necessary for platforms that have fdatasync in headers but have no
75+ # implementation
76+ dnl Originally provided by user copiousfreetime for the beanstalkd project
77+ dnl {{{ make sure that fdatasync exits
78+ AC_CACHE_CHECK ( [ for fdatasync] ,[ ac_cv_func_fdatasync] ,[
79+ AC_COMPILE_IFELSE ( [ AC_LANG_PROGRAM ( [ [
80+ #include <unistd.h>
81+ ] ] ,[ [
82+ fdatasync(4);
83+ ] ] ) ] ,
84+ [ ac_cv_func_fdatasync=yes] ,
85+ [ ac_cv_func_fdatasync=no] )
86+ ] )
87+ AS_IF ( [ test "x${ac_cv_func_fdatasync}" = "xyes"] ,
88+ [ AC_DEFINE ( [ HAVE_FDATASYNC] ,[ 1] ,[ If the system defines fdatasync] ) ] )
89+ dnl }}}
90+
7291AC_CHECK_FUNCS ( [ posix_fadvise posix_fallocate] )
7392
7493# Avoid adding rt if absent or unneeded
You can’t perform that action at this time.
0 commit comments