Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F149793856
D11306.id29954.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D11306.id29954.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,6 +199,22 @@
.Dv MAP_EXCL
is specified, the request will fail if a mapping
already exists within the range.
+.It Dv MAP_GUARD
+Instead of the mapping, create a guard of the specified size.
+The guard prevents any other mappings at its address range,
+until it is unmapped or another mapping is created there with
+the
+.Dv MAP_FIXED
+flag.
+Any memory access to the guarded range results in the
+.Dv SIGSEGV
+signal delivered to the thread.
+.Pp
+Guards allow to create reservations in the address space, which
+can be replaced by the actual mappings later.
+For instance, system uses guards to prevent inadvertent use of grow
+areas for auto-expanded stacks created with
+.Dv MAP_STACK .
.It Dv MAP_HASSEMAPHORE
Notify the kernel that the region may contain semaphores and that special
handling may be necessary.
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
Sat, Mar 28, 3:49 AM (4 h, 34 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
30438440
Default Alt Text
D11306.id29954.diff (1 KB)
Attached To
Mode
D11306: Document MAP_GUARD.
Attached
Detach File
Event Timeline
Log In to Comment