summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2021-10-13 16:41:11 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2021-10-13 16:41:11 +0100
commitcee232b61c1e868e41e08392d9752283ab1a5853 (patch)
treeda5216051de6c1b6daf8ae6ec7a61abc6118f84b
parent2664f9ef9cf3de116bf97f35edd7f9a3db726f28 (diff)
downloadrspamd-cee232b61c1e868e41e08392d9752283ab1a5853.tar.gz
rspamd-cee232b61c1e868e41e08392d9752283ab1a5853.zip
[Minor] Add support for readahead(2) call if available
-rw-r--r--CMakeLists.txt5
-rw-r--r--config.h.in1
2 files changed, 6 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 816e403bd..118f8806f 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -486,6 +486,11 @@ IF(CMAKE_SYSTEM_NAME STREQUAL "Linux")
int main (int argc, char **argv) {
return ((int*)(&recvmmsg))[argc];
}" HAVE_RECVMMSG)
+ CHECK_C_SOURCE_COMPILES ("#define _GNU_SOURCE
+ #include <fcntl.h>
+ int main (int argc, char **argv) {
+ return ((int*)(&readahead))[argc];
+ }" HAVE_READAHEAD)
ELSE()
CHECK_C_SOURCE_RUNS("
#include <sys/mman.h>
diff --git a/config.h.in b/config.h.in
index f83167463..65daa3e29 100644
--- a/config.h.in
+++ b/config.h.in
@@ -64,6 +64,7 @@
#cmakedefine HAVE_PTHREAD_PROCESS_SHARED 1
#cmakedefine HAVE_PWD_H 1
#cmakedefine HAVE_RDTSC 1
+#cmakedefine HAVE_READAHEAD 1
#cmakedefine HAVE_READPASSPHRASE_H 1
#cmakedefine HAVE_RECVMMSG 1
#cmakedefine HAVE_RUSAGE_SELF 1