This is the mail archive of the cygwin mailing list for the Cygwin project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RE: sysconf(_SC_PAGESIZE) set to 64k

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.

Can't think of a witty .sigline today....

Unsubscribe info:
Problem reports:

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]