Skip to content

Include mman.h before disabling non-POSIX headers

vdukhovni requested to merge trac-vdukhovni/ghc:map_anon-non-posix into ghc-8.10

The new use of MAP_ANONYMOUS in rts/sm/Storage.c added in ddb152d5 is not compatible with the extant #include "PosixSource.h" which limits system headers to export only POSIX definitions. In particular, on FreeBSD and Darwin systems, <sys/mman.h> does not define either of MAP_ANON or MAP_ANONYMOUS when "PosixSource.h" is included first.

While we could simply stop limiting rts/sm/Storage.c to POSIX features, for just one non-POSIX macro (at least per FreeBSD and Darwin) it is simple to include <sys/mman.h> first.

Closes: #19456 (closed)

Merge request reports