summaryrefslogtreecommitdiff
path: root/tests/zerosize-ptr.h
diff options
context:
space:
mode:
authorJörg Frings-Fürst <debian@jff.email>2022-01-08 11:53:52 +0100
committerJörg Frings-Fürst <debian@jff.email>2022-01-08 11:53:52 +0100
commitfa838e76139763f902c7d27cb9e1d393ed6a15e4 (patch)
tree7d0ae09775ea950056193eaa2ca93844299d46f1 /tests/zerosize-ptr.h
parentc78359d9542c86b972aac373efcf7bc7a8a560e5 (diff)
parent2959e59fab3bab834368adefd90bd4b1b094366b (diff)
Merge branch 'feature/upstream' into develop
Diffstat (limited to 'tests/zerosize-ptr.h')
-rw-r--r--tests/zerosize-ptr.h9
1 files changed, 5 insertions, 4 deletions
diff --git a/tests/zerosize-ptr.h b/tests/zerosize-ptr.h
index d5592c5..af4ca71 100644
--- a/tests/zerosize-ptr.h
+++ b/tests/zerosize-ptr.h
@@ -1,5 +1,5 @@
/* Return a pointer to a zero-size object in memory.
- Copyright (C) 2009-2018 Free Software Foundation, Inc.
+ Copyright (C) 2009-2022 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -36,8 +36,9 @@
/* 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>
@@ -58,7 +59,7 @@ zerosize_ptr (void)
{
/* 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;