cmake HAVE_POSIX_MADVISE examples

steineggerlab/foldmason lib/foldseek/lib/mmseqs/src/CMakeLists.txt :102

check_cxx_source_compiles("
        #include <stdlib.h>
        #include <fcntl.h>
        #include <stdio.h>
        #include <sys/mman.h>

        int main() {
          FILE* tmpf = tmpfile();
          void *tmp = mmap(NULL, 32, PROT_READ, MAP_SHARED, fileno(tmpf), 0);
          int test = posix_madvise(tmp, 32, POSIX_MADV_SEQUENTIAL);
          fclose(tmpf);
          return 0;
        }"
        HAVE_POSIX_MADVISE)

steineggerlab/foldmason lib/foldseek/lib/mmseqs/src/CMakeLists.txt :117

target_compile_definitions(mmseqs-framework PUBLIC -DHAVE_POSIX_MADVISE=1)

apache/trafficserver CMakeLists.txt :399

check_symbol_exists(posix_madvise sys/mman.h HAVE_POSIX_MADVISE)