From owner-svn-src-all@FreeBSD.ORG Tue Dec 16 20:05:12 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 20BF2D62; Tue, 16 Dec 2014 20:05:12 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E6B9F698; Tue, 16 Dec 2014 20:05:11 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sBGK5BsS079494; Tue, 16 Dec 2014 20:05:11 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sBGK5BFC079493; Tue, 16 Dec 2014 20:05:11 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201412162005.sBGK5BFC079493@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Tue, 16 Dec 2014 20:05:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r275837 - stable/10/lib/libc/sys X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Dec 2014 20:05:12 -0000 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