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])
68
68
AC_CHECK_FUNCS ( [ mkstemps mkdtemp] )
69
69
70
70
# 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
+
72
91
AC_CHECK_FUNCS ( [ posix_fadvise posix_fallocate] )
73
92
74
93
# Avoid adding rt if absent or unneeded
You can’t perform that action at this time.
0 commit comments