Return the correct value for sysconf(_SC_PAGESIZE)

Corinna Vinschen corinna-cygwin@cygwin.com
Tue Nov 15 14:59:00 GMT 2016


On Nov 15 14:51, Erik Bray wrote:
> Greetings,
> 
> Currently sysconf(_SC_PAGESIZE) returns the value of
> wincap.allocation_granularity()--a change I *think* had to have been
> made by mistake in
> https://cygwin.com/git/gitweb.cgi?p=newlib-cygwin.git;a=commit;f=winsup/cygwin/sysconf.cc;h=177dc6c7f6d0608ef6540fd997d9b444e324cae2
> 
> There's no obvious reason, anyways, that this value should be returned
> and not the actual page size.

That's no accident, but a deliberate decision.  Originally we used the
page size at this point, but that's long ago.  This has been discussed
on the cygwin-developers mailing list years ago.  The problem is the
POSIX assumption that the allocation granularity equals the page size.
The only working solution which does not break assumptions is to return
the allocation granularity as page size.


Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Maintainer                 cygwin AT cygwin DOT com
Red Hat
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://cygwin.com/pipermail/cygwin-patches/attachments/20161115/9fb80042/attachment.sig>


More information about the Cygwin-patches mailing list