From owner-freebsd-hackers@FreeBSD.ORG Wed Jun 14 12:05:48 2006 Return-Path: X-Original-To: hackers@freebsd.org Delivered-To: freebsd-hackers@FreeBSD.ORG Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 6E17216A41A; Wed, 14 Jun 2006 12:05:48 +0000 (UTC) (envelope-from bruno@clisp.org) Received: from ftp.ilog.fr (ftp.ilog.fr [81.80.162.195]) by mx1.FreeBSD.org (Postfix) with ESMTP id 7BDFE43D49; Wed, 14 Jun 2006 12:05:46 +0000 (GMT) (envelope-from bruno@clisp.org) Received: from laposte.ilog.fr (cerbere-qfe0 [81.80.162.193]) by ftp.ilog.fr (8.13.1/8.13.1) with ESMTP id k5EC5eeE002970; Wed, 14 Jun 2006 14:05:40 +0200 Received: from marbore.ilog.biz (marbore.ilog.biz [172.17.2.61]) by laposte.ilog.fr (8.13.1/8.13.1) with ESMTP id k5EC5X6S028958; Wed, 14 Jun 2006 14:05:33 +0200 Received: from honolulu.ilog.fr ([172.16.15.121]) by marbore.ilog.biz with Microsoft SMTPSVC(6.0.3790.1830); Wed, 14 Jun 2006 14:05:49 +0200 Received: by honolulu.ilog.fr (Postfix, from userid 1001) id E741EF1433; Wed, 14 Jun 2006 14:04:08 +0200 (CEST) From: Bruno Haible To: Konstantin Belousov Date: Wed, 14 Jun 2006 14:04:08 +0200 User-Agent: KMail/1.9.1 References: <200606101822.46437.bruno@clisp.org> <20060614103420.GA86300@deviant.kiev.zoral.com.ua> In-Reply-To: <20060614103420.GA86300@deviant.kiev.zoral.com.ua> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200606141404.08811.bruno@clisp.org> X-OriginalArrivalTime: 14 Jun 2006 12:05:49.0578 (UTC) FILETIME=[E03A7EA0:01C68FAA] X-Mailman-Approved-At: Wed, 14 Jun 2006 12:08:28 +0000 Cc: Vasil Dimov , hackers@freebsd.org Subject: Re: valid VMA ranges and mincore() X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Jun 2006 12:05:48 -0000 Hello Konstantin, Thanks for reacting on this issue. > Please, evaluate the patch. If it does what you need - It doesn't change the manual page mincore.2. - For unmapped areas, it appears to be filling in values of -1 into the array. This is not what Linux, Solaris, NetBSD do: They return -1 from the system call and set errno to ENOMEM. See Linux: http://linux.about.com/library/cmd/blcmdl2_mincore.htm Solaris: http://docs.sun.com/app/docs/doc/816-5167/6mbb2jaib?a=view NetBSD: http://cvsweb.netbsd.org/bsdweb.cgi/src/lib/libc/sys/mincore.2?rev=1.19&content-type=text/plain - Filling in values of -1 into the array will confuse existing applications, because -1 is all bits set, i.e. the nonexistent pages will appear to be in-core, modified, referenced. - Filling in values of -1 into the array could be done more easily by changing the statements in sys/vm/vm_mmap.c lines 861 and 902. Thanks. Bruno