summaryrefslogtreecommitdiff
path: root/tests/zerosize-ptr.h
diff options
context:
space:
mode:
authorJörg Frings-Fürst <debian@jff.email>2022-01-08 11:51:07 +0100
committerJörg Frings-Fürst <debian@jff.email>2022-01-08 11:51:07 +0100
commitbe8efac78d067c138ad8dda03df4336e73f94887 (patch)
tree5f5254a628ba0ef72065b93d949d1c985742ea8e /tests/zerosize-ptr.h
parent7b65dbd4ebade81d504cfe5e681292a58ad1fdf0 (diff)
New upstream version 1.0upstream/1.0
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;