diff options
author | Dmitry Shulga <dmitry.shulga@mariadb.com> | 2022-04-22 18:47:19 +0700 |
---|---|---|
committer | Dmitry Shulga <dmitry.shulga@mariadb.com> | 2022-04-22 18:47:19 +0700 |
commit | bc7ba7afee8ba6f7d8fe61078d4c46184dc6fa56 (patch) | |
tree | aebe1770a349f214a1f262e5cd91cc9637dbe431 | |
parent | 3c209bfc040ddfc41ece8357d772547432353fd2 (diff) | |
download | mariadb-git-bc7ba7afee8ba6f7d8fe61078d4c46184dc6fa56.tar.gz |
MDEV-27758: Errors when building Connect engine on os x 11.6.2
Added checking for support of vfork by a platform where
building being done. Set HAVE_VFORK macros in case vfork()
system call is supported. Use vfork() system call if the
macros HAVE_VFORK is set, else use fork().
-rw-r--r-- | config.h.cmake | 2 | ||||
-rw-r--r-- | configure.cmake | 16 | ||||
-rw-r--r-- | storage/connect/tabrest.cpp | 6 |
3 files changed, 23 insertions, 1 deletions
diff --git a/config.h.cmake b/config.h.cmake index c74592b4a65..3a43c6132f0 100644 --- a/config.h.cmake +++ b/config.h.cmake @@ -577,3 +577,5 @@ #endif // !defined(__STDC_FORMAT_MACROS) #endif + +#cmakedefine HAVE_VFORK 1 diff --git a/configure.cmake b/configure.cmake index 942d5780ed9..3ac42e8e3e4 100644 --- a/configure.cmake +++ b/configure.cmake @@ -1033,3 +1033,19 @@ IF(NOT MSVC) HAVE_FALLOC_PUNCH_HOLE_AND_KEEP_SIZE ) ENDIF() + +MY_CHECK_C_COMPILER_FLAG("-Werror") +IF(have_C__Werror) + SET(SAVE_CMAKE_REQUIRED_FLAGS ${CMAKE_REQUIRED_FLAGS}) + SET(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} -Werror") + CHECK_C_SOURCE_COMPILES(" + #include <unistd.h> + int main() + { + pid_t pid=vfork(); + return (int)pid; + }" + HAVE_VFORK + ) + SET(CMAKE_REQUIRED_FLAGS ${SAVE_CMAKE_REQUIRED_FLAGS}) +ENDIF() diff --git a/storage/connect/tabrest.cpp b/storage/connect/tabrest.cpp index c66d8d76f3d..7e8b51714fb 100644 --- a/storage/connect/tabrest.cpp +++ b/storage/connect/tabrest.cpp @@ -112,7 +112,11 @@ int Xcurl(PGLOBAL g, PCSZ Http, PCSZ Uri, PCSZ filename) } // endif f - pID = vfork(); +#ifdef HAVE_VFORK + pID = vfork(); +#else + pID = fork(); +#endif sprintf(fn, "-o%s", filename); if (pID == 0) { |