svn commit: r275837 - stable/10/lib/libc/sys

John Baldwin jhb at FreeBSD.org
Tue Dec 16 20:05:12 UTC 2014


Author: jhb
Date: Tue Dec 16 20:05:10 2014
New Revision: 275837
URL: https://svnweb.freebsd.org/changeset/base/275837

Log:
  MFC 271635,271722:
  - Only the manpage updates from 271635 are merged to give additional
    heads up for the stricter checks in 11, but the kernel in 10 remains
    permissive.
    - Fail with EINVAL if an invalid protection mask is passed to mmap().
    - Fail with EINVAL if an unknown flag is passed to mmap().
    - Fail with EINVAL if both MAP_PRIVATE and MAP_SHARED are passed to
      mmap().
    - Require one of either MAP_PRIVATE or MAP_SHARED for non-anonymous
      mappings.
  - Remove mention of MAP_INHERIT.  It hasn't been implemented for thirteen
    years.
  - Remove mention of unimplemented MAP_SWAP.  There are no future plans to
    implement it.

Modified:
  stable/10/lib/libc/sys/mmap.2
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/lib/libc/sys/mmap.2
==============================================================================
--- stable/10/lib/libc/sys/mmap.2	Tue Dec 16 19:45:56 2014	(r275836)
+++ stable/10/lib/libc/sys/mmap.2	Tue Dec 16 20:05:10 2014	(r275837)
@@ -28,7 +28,7 @@
 .\"	@(#)mmap.2	8.4 (Berkeley) 5/11/95
 .\" $FreeBSD$
 .\"
-.Dd June 19, 2014
+.Dd September 17, 2014
 .Dt MMAP 2
 .Os
 .Sh NAME
@@ -176,11 +176,6 @@ 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_INHERIT
-This flag never operated as advertised and is no longer supported.
-Please refer to
-.Xr minherit 2
-for further information.
 .It Dv MAP_NOCORE
 Region is not included in a core file.
 .It Dv MAP_NOSYNC
@@ -300,14 +295,6 @@ The
 system call does not unmap pages, see
 .Xr munmap 2
 for further information.
-.Pp
-The current design does not allow a process to specify the location of
-swap space.
-In the future we may define an additional mapping type,
-.Dv MAP_SWAP ,
-in which
-the file descriptor argument specifies a file or device to which swapping
-should be done.
 .Sh NOTES
 Although this implementation does not impose any alignment restrictions on
 the
@@ -372,6 +359,29 @@ The
 argument
 is not a valid open file descriptor.
 .It Bq Er EINVAL
+An invalid value was passed in the
+.Fa prot
+argument.
+.It Bq Er EINVAL
+An undefined option was set in the
+.Fa flags
+argument.
+.It Bq Er EINVAL
+Both
+.Dv MAP_PRIVATE
+and
+.Dv MAP_SHARED
+were specified.
+.It Bq Er EINVAL
+None of
+.Dv MAP_ANON ,
+.Dv MAP_PRIVATE ,
+.Dv MAP_SHARED ,
+or
+.Dv MAP_STACK
+was specified.
+At least one of these flags must be included.
+.It Bq Er EINVAL
 .Dv MAP_FIXED
 was specified and the
 .Fa addr


More information about the svn-src-stable mailing list