diff options
author | jhb <jhb@FreeBSD.org> | 2013-09-09 18:11:59 +0000 |
---|---|---|
committer | jhb <jhb@FreeBSD.org> | 2013-09-09 18:11:59 +0000 |
commit | 04bb6e10cd2cbd0ee0de7fef3f81e88ebd43e6b4 (patch) | |
tree | 42d2ff2e91fcca16534848427856c6243db2126a /lib | |
parent | 2a48fed0b32ceb1567f3b7e33835bacfdf3e0971 (diff) | |
download | FreeBSD-src-04bb6e10cd2cbd0ee0de7fef3f81e88ebd43e6b4.zip FreeBSD-src-04bb6e10cd2cbd0ee0de7fef3f81e88ebd43e6b4.tar.gz |
Add a mmap flag (MAP_32BIT) on 64-bit platforms to request that a mapping use
an address in the first 2GB of the process's address space. This flag should
have the same semantics as the same flag on Linux.
To facilitate this, add a new parameter to vm_map_find() that specifies an
optional maximum virtual address. While here, fix several callers of
vm_map_find() to use a VMFS_* constant for the findspace argument instead of
TRUE and FALSE.
Reviewed by: alc
Approved by: re (kib)
Diffstat (limited to 'lib')
-rw-r--r-- | lib/libc/sys/mmap.2 | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/lib/libc/sys/mmap.2 b/lib/libc/sys/mmap.2 index 130f70b..01cde0e 100644 --- a/lib/libc/sys/mmap.2 +++ b/lib/libc/sys/mmap.2 @@ -28,7 +28,7 @@ .\" @(#)mmap.2 8.4 (Berkeley) 5/11/95 .\" $FreeBSD$ .\" -.Dd August 16, 2013 +.Dd September 9, 2013 .Dt MMAP 2 .Os .Sh NAME @@ -98,6 +98,12 @@ argument by .Em or Ns 'ing the following values: .Bl -tag -width MAP_PREFAULT_READ +.It Dv MAP_32BIT +Request a region in the first 2GB of the current process's address space. +If a suitable region cannot be found, +.Fn mmap +will fail. +This flag is only available on 64-bit platforms. .It Dv MAP_ALIGNED Ns Pq Fa n Align the region on a requested boundary. If a suitable region cannot be found, @@ -362,6 +368,13 @@ was specified and the argument was not page aligned, or part of the desired address space resides out of the valid address space for a user process. .It Bq Er EINVAL +Both +.Dv MAP_FIXED +and +.Dv MAP_32BIT +were specified and part of the desired address space resides outside +of the first 2GB of user address space. +.It Bq Er EINVAL The .Fa len argument |