1 --- storage/myisam/mi_dynrec.cc.orig	2024-04-10 06:26:28 UTC
2 +++ storage/myisam/mi_dynrec.cc
3 @@ -86,17 +86,12 @@ bool mi_dynmap_file(MI_INFO *info, my_off_t size) {
4      return true;
5    }
6    /*
7 -    I wonder if it is good to use MAP_NORESERVE. From the Linux man page:
8 -    MAP_NORESERVE
9 -      Do not reserve swap space for this mapping. When swap space is
10 -      reserved, one has the guarantee that it is possible to modify the
11 -      mapping. When swap space is not reserved one might get SIGSEGV
12 -      upon a write if no physical memory is available.
13 +    MAP_NORESERVE is unimplemented in FreeBSD
14    */
15    info->s->file_map = (uchar *)my_mmap(
16        nullptr, (size_t)size,
17        info->s->mode == O_RDONLY ? PROT_READ : PROT_READ | PROT_WRITE,
18 -      MAP_SHARED | MAP_NORESERVE, info->dfile, 0L);
19 +      MAP_SHARED, info->dfile, 0L);
20    if (info->s->file_map == (uchar *)MAP_FAILED) {
21      info->s->file_map = nullptr;
22      return true;
23