delorie.com/archives/browse.cgi | search |
X-Spam-Check-By: | sourceware.org |
From: | "Dave Korn" <dave DOT korn AT artimi DOT com> |
To: | <cygwin AT cygwin DOT com> |
Subject: | RE: sysconf(_SC_PAGESIZE) set to 64k |
Date: | Thu, 15 Jun 2006 15:09:50 +0100 |
Message-ID: | <002d01c69085$5d97aff0$a501a8c0@CAM.ARTIMI.COM> |
MIME-Version: | 1.0 |
X-Mailer: | Microsoft Office Outlook 11 |
In-Reply-To: | <153F17DAEC71B743B926B2AE6CA04FDA03BDA7@WOLVES.renovosoftware.com> |
Mailing-List: | contact cygwin-help AT cygwin DOT com; run by ezmlm |
List-Unsubscribe: | <mailto:cygwin-unsubscribe-archive-cygwin=delorie DOT com AT cygwin DOT com> |
List-Subscribe: | <mailto:cygwin-subscribe AT cygwin DOT com> |
List-Archive: | <http://sourceware.org/ml/cygwin/> |
List-Post: | <mailto:cygwin AT cygwin DOT com> |
List-Help: | <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs> |
Sender: | cygwin-owner AT cygwin DOT com |
Mail-Followup-To: | cygwin AT cygwin DOT com |
Delivered-To: | mailing list cygwin AT cygwin DOT com |
On 15 June 2006 14:56, Ehren Jarosek wrote: > I don't know if this is something I am doing wrong or an issue. > > When compiling under cygwin sysconf(_SC_PAGESIZE) returns 65536 (64k) > memory page size. My understanding is that: > > sysconf(_SC_PAGESIZE) * sysconf(_SC_PHYS_PAGES) > > should yield the total physical memory size of the machine. However, > when I do this it yields a very large number (actually overflows my > long). However, if I multiply sysconf(_SC_PHYS_PAGES) * 4096 it yields > the correct size. Alas there is a problem with the definition of sysconf: it is supposed to be the size of the unit of granularity of mmap'ing, but it is also supposed to be the size of a single pageframe of memory. While it is a correct assumption on Linux that these things are one and the same, on 'doze you can only mmap pages in blocks of 64kB, but the pages themselves (the granularity of RWX access protection rather than of VAD mapping) are the standard 4kB size. This is a limitation of the underlying windows o/s. cheers, DaveK -- Can't think of a witty .sigline today.... -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/
webmaster | delorie software privacy |
Copyright © 2019 by DJ Delorie | Updated Jul 2019 |