about summary refs log tree commit diff
path: root/sysdeps/mach/hurd/bits
diff options
context:
space:
mode:
authorSergey Bugaev <bugaevc@gmail.com>2023-04-24 00:55:23 +0300
committerSamuel Thibault <samuel.thibault@ens-lyon.org>2023-04-24 22:42:12 +0200
commit70b9173caa3a6e8e4cc1c8ebe93ed15a19388687 (patch)
tree99a5c9ff253c8e1c2f7d3a0e3a9c39b74711ef2d /sysdeps/mach/hurd/bits
parent533deafbdf189f5fbb280c28562dd43ace2f4b0f (diff)
downloadglibc-70b9173caa3a6e8e4cc1c8ebe93ed15a19388687.tar.gz
glibc-70b9173caa3a6e8e4cc1c8ebe93ed15a19388687.tar.xz
glibc-70b9173caa3a6e8e4cc1c8ebe93ed15a19388687.zip
hurd: Implement MAP_32BIT
This is a flag that can be passed to mmap () to request that the mapping
being established should be located in the lower 2 GB area of the
address space, so only the lower 31 (not 32) bits can be set in its
address, and the address can be represented as a 32-bit integer without
truncating it.

This flag is intended to be compatible with Linux, FreeBSD, and Darwin
flags of the same name. Out of those systems, it appears Linux and
FreeBSD take MAP_32BIT to mean "map 31 bit", whereas Darwin allows the
32nd bit to be set in the address as well. The Hurd follows Linux and
FreeBSD behavior.

Unlike on those systems, on the Hurd MAP_32BIT is defined on all
supported architectures (which currently are only i386 and x86_64).

Signed-off-by: Sergey Bugaev <bugaevc@gmail.com>
Message-Id: <20230423215526.346009-1-bugaevc@gmail.com>
Diffstat (limited to 'sysdeps/mach/hurd/bits')
-rw-r--r--sysdeps/mach/hurd/bits/mman_ext.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/sysdeps/mach/hurd/bits/mman_ext.h b/sysdeps/mach/hurd/bits/mman_ext.h
index f022826eee..bbb94743e9 100644
--- a/sysdeps/mach/hurd/bits/mman_ext.h
+++ b/sysdeps/mach/hurd/bits/mman_ext.h
@@ -22,4 +22,5 @@
 
 #ifdef __USE_GNU
 # define SHM_ANON	((const char *) 1)
+# define MAP_32BIT	0x1000
 #endif /* __USE_GNU  */