From owner-svn-src-all@FreeBSD.ORG Fri May 23 05:35:44 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 36717236; Fri, 23 May 2014 05:35:44 +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 09A442338; Fri, 23 May 2014 05:35:44 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4N5Zhqx028218; Fri, 23 May 2014 05:35:43 GMT (envelope-from pho@svn.freebsd.org) Received: (from pho@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4N5ZhIO028216; Fri, 23 May 2014 05:35:43 GMT (envelope-from pho@svn.freebsd.org) Message-Id: <201405230535.s4N5ZhIO028216@svn.freebsd.org> From: Peter Holm Date: Fri, 23 May 2014 05:35:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r266574 - in stable/8: lib/libc/sys sys/vm X-SVN-Group: stable-8 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 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: Fri, 23 May 2014 05:35:44 -0000 Author: pho Date: Fri May 23 05:35:43 2014 New Revision: 266574 URL: http://svnweb.freebsd.org/changeset/base/266574 Log: MFC r265534: msync(2) must return ENOMEM and not EINVAL when the address is outside the allowed range or when one or more pages are not mapped. This according to The Open Group Base Specifications Issue 7. Sponsored by: EMC / Isilon storage division Modified: stable/8/lib/libc/sys/msync.2 stable/8/sys/vm/vm_mmap.c Directory Properties: stable/8/ (props changed) stable/8/lib/ (props changed) stable/8/lib/libc/ (props changed) stable/8/lib/libc/sys/ (props changed) stable/8/sys/ (props changed) stable/8/sys/vm/ (props changed) Modified: stable/8/lib/libc/sys/msync.2 ============================================================================== --- stable/8/lib/libc/sys/msync.2 Fri May 23 05:15:17 2014 (r266573) +++ stable/8/lib/libc/sys/msync.2 Fri May 23 05:35:43 2014 (r266574) @@ -87,11 +87,13 @@ The .Fa addr argument is not a multiple of the hardware page size. -.It Bq Er EINVAL -The +.It Bq Er ENOMEM +The addresses in the range starting at +.Fa addr +and continuing for .Fa len -argument -is too large or negative. +bytes are outside the range allowed for the address space of a +process or specify one or more pages that are not mapped. .It Bq Er EINVAL The .Fa flags @@ -99,7 +101,7 @@ argument was both MS_ASYNC and MS_INVALIDATE. Only one of these flags is allowed. .It Bq Er EIO - An error occurred while writing at least one of the pages in +An error occurred while writing at least one of the pages in the specified region. .El .Sh SEE ALSO Modified: stable/8/sys/vm/vm_mmap.c ============================================================================== --- stable/8/sys/vm/vm_mmap.c Fri May 23 05:15:17 2014 (r266573) +++ stable/8/sys/vm/vm_mmap.c Fri May 23 05:35:43 2014 (r266574) @@ -497,7 +497,7 @@ msync(td, uap) case KERN_SUCCESS: return (0); case KERN_INVALID_ADDRESS: - return (EINVAL); /* Sun returns ENOMEM? */ + return (ENOMEM); case KERN_INVALID_ARGUMENT: return (EBUSY); case KERN_FAILURE: