diff options
author | Florian Weimer <fweimer@redhat.com> | 2023-04-11 09:39:40 +0200 |
---|---|---|
committer | Daniel Black <daniel@mariadb.org> | 2023-04-17 17:21:26 +1000 |
commit | f575de39afacb24cd43c40bf43c27bfcf97a670b (patch) | |
tree | a2dad9752af8570aec99f8d14c51db01aa655f66 | |
parent | 2e1c532bd2d9f9a35559e54f66d33c81e33009b1 (diff) | |
download | mariadb-git-f575de39afacb24cd43c40bf43c27bfcf97a670b.tar.gz |
rocksdb: Define _GNU_SOURCE during fallocate CMake probe
The glibc headers declare fallocate only if _GNU_SOURCE is defined.
Without this change, the probe fails with C compilers which do not
support implicit function declarations even if the system does in
fact support the fallocate function.
Upstream rocksdb does not need this because the probe is run with the
C++ compiler, and current g++ versions define _GNU_SOURCE
automatically.
-rw-r--r-- | storage/rocksdb/build_rocksdb.cmake | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/storage/rocksdb/build_rocksdb.cmake b/storage/rocksdb/build_rocksdb.cmake index 647e51e2f90..ba894d83d75 100644 --- a/storage/rocksdb/build_rocksdb.cmake +++ b/storage/rocksdb/build_rocksdb.cmake @@ -134,8 +134,8 @@ option(WITH_FALLOCATE "build with fallocate" ON) if(WITH_FALLOCATE AND UNIX) include(CheckCSourceCompiles) CHECK_C_SOURCE_COMPILES(" +#define _GNU_SOURCE #include <fcntl.h> -#include <linux/falloc.h> int main() { int fd = open(\"/dev/null\", 0); fallocate(fd, FALLOC_FL_KEEP_SIZE | FALLOC_FL_PUNCH_HOLE, 0, 1024); |