From 4ac5a610018dda642f8024a77aa8d304308c6680 Mon Sep 17 00:00:00 2001
From: Konstantin Osipov <kostja@tarantool.org>
Date: Thu, 10 Oct 2013 19:01:18 +0400
Subject: [PATCH] Another attempt to fix fdatasync() on Darwin and FreeBSD

Use check_symbol_exists(), not check_function_exists(),
to discover fdatasync(), since apparently on some BSD systems
the symbol is present in the library but not in the headers
(I hope not vice versa).

Don't use check_prototype_definition, since it's not available
in CMake 2.6.
---
 CMakeLists.txt | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 287a889ed3..125269efb3 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -74,7 +74,7 @@ check_include_file(cpuid.h HAVE_CPUID_H)
 check_include_file(sys/prctl.h HAVE_PRCTL_H)
 
 check_symbol_exists(O_DSYNC fcntl.h HAVE_O_DSYNC)
-check_function_exists(fdatasync HAVE_FDATASYNC)
+check_symbol_exists(fdatasync unistd.h HAVE_FDATASYNC)
 check_function_exists(memmem HAVE_MEMMEM)
 check_function_exists(memrchr HAVE_MEMRCHR)
 
-- 
GitLab