Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F136552331
D11306.id30005.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
2 KB
Referenced Files
None
Subscribers
None
D11306.id30005.diff
View Options
Index: lib/libc/sys/mmap.2
===================================================================
--- lib/libc/sys/mmap.2
+++ lib/libc/sys/mmap.2
@@ -28,7 +28,7 @@
.\" @(#)mmap.2 8.4 (Berkeley) 5/11/95
.\" $FreeBSD$
.\"
-.Dd February 4, 2017
+.Dd June 22, 2017
.Dt MMAP 2
.Os
.Sh NAME
@@ -199,9 +199,21 @@
.Dv MAP_EXCL
is specified, the request will fail if a mapping
already exists within the range.
-.It Dv MAP_HASSEMAPHORE
-Notify the kernel that the region may contain semaphores and that special
-handling may be necessary.
+.It Dv MAP_GUARD
+Instead of a mapping, create a guard of the specified size.
+Guards allow a process to create reservations in its address space,
+which can later be replaced by actual mappings.
+.Pp
+.Fa mmap
+will not create mappings in the address range of a guard unless
+the request specifies
+.Dv MAP_FIXED .
+Guards can be destroyed with
+.Xr munmap 2 .
+Any memory access by a thread to the guarded range results
+in the delivery of a
+.Dv SIGSEGV
+signal to that thread.
.It Dv MAP_NOCORE
Region is not included in a core file.
.It Dv MAP_NOSYNC
@@ -306,6 +318,7 @@
.Dv PROT_READ
and
.Dv PROT_WRITE .
+.Pp
This option creates
a memory region that grows to at most
.Fa len
@@ -316,6 +329,10 @@
bytes.
The bottom of the stack at maximum growth is the starting
address returned by the call.
+The system uses guards to prevent the inadvertent use of
+regions into which stacks created with
+.Dv MAP_STACK
+will automatically grow, without mapping the whole stack in advance.
.El
.Pp
The
@@ -458,6 +475,16 @@
was specified, but
.Dv MAP_FIXED
was not.
+.It Bq Er EINVAL
+.Dv MAP_GUARD
+was specified, but either the
+.Fa offset
+argument was not zero, or the
+.Fa fd
+argument was not -1, or the
+.Fa prot
+argument was not
+.Dv PROT_NONE .
.It Bq Er ENODEV
.Dv MAP_ANON
has not been specified and
Index: lib/libc/sys/munmap.2
===================================================================
--- lib/libc/sys/munmap.2
+++ lib/libc/sys/munmap.2
@@ -28,7 +28,7 @@
.\" @(#)munmap.2 8.3 (Berkeley) 5/27/94
.\" $FreeBSD$
.\"
-.Dd May 27, 1994
+.Dd June 22, 2017
.Dt MUNMAP 2
.Os
.Sh NAME
@@ -44,7 +44,7 @@
The
.Fn munmap
system call
-deletes the mappings for the specified address range,
+deletes the mappings and guards for the specified address range,
and causes further references to addresses within the range
to generate invalid memory references.
.Sh RETURN VALUES
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Wed, Nov 19, 7:21 AM (4 h, 30 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
25609075
Default Alt Text
D11306.id30005.diff (2 KB)
Attached To
Mode
D11306: Document MAP_GUARD.
Attached
Detach File
Event Timeline
Log In to Comment