+2021-01-19 KO Myung-Hun <komh78@gmail.com>
+
+ zerosize-ptr: Fix compilation on OS/2 kLIBC.
+ * tests/zerosize-ptr.h [OS/2 kLIBC]: Don't use mmap().
+
2021-01-19 KO Myung-Hun <komh78@gmail.com>
stddef: Fix compilation for max_align_t on OS/2 kLIBC.
/* Test whether mmap() and mprotect() are available.
We don't use HAVE_MMAP, because AC_FUNC_MMAP would not define it on HP-UX.
HAVE_MPROTECT is not enough, because mingw does not have mmap() but has an
- mprotect() function in libgcc.a. */
-#if HAVE_SYS_MMAN_H && HAVE_MPROTECT
+ mprotect() function in libgcc.a.
+ And OS/2 kLIBC has <sys/mman.h> and mprotect(), but not mmap(). */
+#if HAVE_SYS_MMAN_H && HAVE_MPROTECT && !defined __KLIBC__
# include <fcntl.h>
# include <unistd.h>
# include <sys/types.h>
{
/* Use mmap and mprotect when they exist. Don't test HAVE_MMAP, because it is
not defined on HP-UX 11 (since it does not support MAP_FIXED). */
-#if HAVE_SYS_MMAN_H && HAVE_MPROTECT
+#if HAVE_SYS_MMAN_H && HAVE_MPROTECT && !defined __KLIBC__
# if HAVE_MAP_ANONYMOUS
const int flags = MAP_ANONYMOUS | MAP_PRIVATE;
const int fd = -1;