From dev-return-24375-apmail-apr-dev-archive=apr.apache.org@apr.apache.org Fri Aug 12 21:12:44 2011 Return-Path: X-Original-To: apmail-apr-dev-archive@www.apache.org Delivered-To: apmail-apr-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 381FC8190 for ; Fri, 12 Aug 2011 21:12:44 +0000 (UTC) Received: (qmail 78232 invoked by uid 500); 12 Aug 2011 21:12:43 -0000 Delivered-To: apmail-apr-dev-archive@apr.apache.org Received: (qmail 78124 invoked by uid 500); 12 Aug 2011 21:12:43 -0000 Mailing-List: contact dev-help@apr.apache.org; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Id: Delivered-To: mailing list dev@apr.apache.org Received: (qmail 78116 invoked by uid 99); 12 Aug 2011 21:12:42 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 12 Aug 2011 21:12:42 +0000 X-ASF-Spam-Status: No, hits=0.7 required=5.0 tests=RCVD_IN_DNSWL_NONE,SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (nike.apache.org: local policy) Received: from [173.201.192.105] (HELO p3plsmtpa06-04.prod.phx3.secureserver.net) (173.201.192.105) by apache.org (qpsmtpd/0.29) with SMTP; Fri, 12 Aug 2011 21:12:33 +0000 Received: (qmail 27345 invoked from network); 12 Aug 2011 21:12:11 -0000 Received: from unknown (76.252.112.72) by p3plsmtpa06-04.prod.phx3.secureserver.net (173.201.192.105) with ESMTP; 12 Aug 2011 21:12:11 -0000 Message-ID: <4E459700.4090806@rowe-clan.net> Date: Fri, 12 Aug 2011 16:11:28 -0500 From: "William A. Rowe Jr." User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:5.0) Gecko/20110624 Thunderbird/5.0 MIME-Version: 1.0 To: dev@apr.apache.org Subject: Re: Emulation of /dev/zero on Windows References: <32250236.post@talk.nabble.com> <32250714.post@talk.nabble.com> <4E454C1C.4090203@rowe-clan.net> <32251583.post@talk.nabble.com> <32251635.post@talk.nabble.com> In-Reply-To: <32251635.post@talk.nabble.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org On 8/12/2011 11:19 AM, sidinsd wrote: > > I just read the doc for "MapViewOfFile" and I quote it below; > > If a file mapping object is backed by the paging file (CreateFileMapping is > called with the hFile parameter set to INVALID_HANDLE_VALUE), the paging > file must be large enough to hold the entire mapping. If it is not, > MapViewOfFile fails. The initial contents of the pages in a file mapping > object backed by the paging file are 0 (zero). Precisely. But the pages returned are from the unallocated memory, never allocated memory! Think of this as a cross-process calloc() where you haven't named a specific backing store. This is true on unix as well. APR offers no means to access memory allocated by other processes, if that is what you are trying to accomplish.