Commit f575de39 authored by Florian Weimer's avatar Florian Weimer Committed by Daniel Black

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.
parent 2e1c532b
...@@ -134,8 +134,8 @@ option(WITH_FALLOCATE "build with fallocate" ON) ...@@ -134,8 +134,8 @@ option(WITH_FALLOCATE "build with fallocate" ON)
if(WITH_FALLOCATE AND UNIX) if(WITH_FALLOCATE AND UNIX)
include(CheckCSourceCompiles) include(CheckCSourceCompiles)
CHECK_C_SOURCE_COMPILES(" CHECK_C_SOURCE_COMPILES("
#define _GNU_SOURCE
#include <fcntl.h> #include <fcntl.h>
#include <linux/falloc.h>
int main() { int main() {
int fd = open(\"/dev/null\", 0); int fd = open(\"/dev/null\", 0);
fallocate(fd, FALLOC_FL_KEEP_SIZE | FALLOC_FL_PUNCH_HOLE, 0, 1024); fallocate(fd, FALLOC_FL_KEEP_SIZE | FALLOC_FL_PUNCH_HOLE, 0, 1024);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment