From 70b9173caa3a6e8e4cc1c8ebe93ed15a19388687 Mon Sep 17 00:00:00 2001 From: Sergey Bugaev Date: Mon, 24 Apr 2023 00:55:23 +0300 Subject: 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 Message-Id: <20230423215526.346009-1-bugaevc@gmail.com> --- sysdeps/mach/hurd/bits/mman_ext.h | 1 + 1 file changed, 1 insertion(+) (limited to 'sysdeps/mach/hurd/bits') 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 */ -- cgit v1.2.3