]> source.dussan.org Git - rspamd.git/commitdiff
[Minor] Add support for readahead(2) call if available
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Wed, 13 Oct 2021 15:41:11 +0000 (16:41 +0100)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Wed, 13 Oct 2021 15:41:11 +0000 (16:41 +0100)
CMakeLists.txt
config.h.in

index 816e403bdc6e6993ae3df6e9f4c795ebb50303d1..118f8806fcdad914363afe48549e4622d5da5e0e 100644 (file)
@@ -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>
index f83167463fa0757908e3904e12906772e9f85638..65daa3e2907787e4fed6f0ff28364d4da309fdbe 100644 (file)
@@ -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