This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
PATCH: Define MAP_32BIT only if __WORDSIZE is 64
- From: "H.J. Lu" <hongjiu dot lu at intel dot com>
- To: GNU C Library <libc-alpha at sourceware dot org>
- Date: Thu, 31 May 2012 07:44:18 -0700
- Subject: PATCH: Define MAP_32BIT only if __WORDSIZE is 64
- Reply-to: "H.J. Lu" <hjl dot tools at gmail dot com>
Hi,
This patch defines MAP_32BIT in x86_64/bits/mman.h only if __WORDSIZE is
64. OK to install?
Thanks.
H.J.
---
* sysdeps/unix/sysv/linux/x86_64/bits/mman.h: Include
<bits/wordsize.h>.
(MAP_32BIT): Define only if __WORDSIZE is 64.
diff --git a/sysdeps/unix/sysv/linux/x86_64/bits/mman.h b/sysdeps/unix/sysv/linux/x86_64/bits/mman.h
index 28b9160..3f2599a 100644
--- a/sysdeps/unix/sysv/linux/x86_64/bits/mman.h
+++ b/sysdeps/unix/sysv/linux/x86_64/bits/mman.h
@@ -20,6 +20,8 @@
# error "Never use <bits/mman.h> directly; include <sys/mman.h> instead."
#endif
+#include <bits/wordsize.h>
+
/* The following definitions basically come from the kernel headers.
But the kernel header is not namespace clean. */
@@ -51,7 +53,9 @@
# define MAP_FILE 0
# define MAP_ANONYMOUS 0x20 /* Don't use a file. */
# define MAP_ANON MAP_ANONYMOUS
-# define MAP_32BIT 0x40 /* Only give out 32-bit addresses. */
+# if __WORDSIZE == 64
+# define MAP_32BIT 0x40 /* Only give out 32-bit addresses. */
+# endif
#endif
/* These are Linux-specific. */