X-Spam-Check-By: sourceware.org
To: cygwin@cygwin.com
From: =?ISO-8859-1?Q?Ren=E9_Berber?= <r.berber@computer.org>
Subject:  Re: mmap() on 64K aligned address fails
Date:  Sat, 26 Nov 2005 15:19:06 -0600
Lines: 23
Message-ID: <dmajga$8lq$1@sea.gmane.org>
References:  <dm8oki$48t$1@sea.gmane.org> <20051126180331.GI5074@bouh.residence.ens-lyon.fr>
Mime-Version:  1.0
Content-Type:  text/plain; charset=ISO-8859-1
Content-Transfer-Encoding:  quoted-printable
User-Agent: Mozilla Thunderbird 1.0.2 (Windows/20050317)
In-Reply-To: <20051126180331.GI5074@bouh.residence.ens-lyon.fr>
OpenPGP: url=ldap://keyserver.pgp.com
X-IsSubscribed: yes
Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
Precedence: bulk
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie.com@cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe@cygwin.com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-help@cygwin.com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
Delivered-To: mailing list cygwin@cygwin.com

Samuel Thibault wrote:
[snip]
> This seems odd. In the cygwin case, pagesize() would not be sufficient ??

No, in windows there is a requirement that mmap uses memory aligned to 64k =
(the
infamous granularity).

> And anyway, it should rather be=20
>    data2 =3D (char *) malloc (2 * 16 * pagesize);
> Not only 16 (since it is further 16*pagesize -aligned).

It's enough to allocate 16 x pagesize to use one page for mmap-ing (like Co=
rinna
said in one message 15/16 pages will not be aligned -- but one will).  If y=
ou
see the intermediate results I printed, data2 is re-aligned to 64k correctl=
y.

Anyway, I still don't know why mmap() failded.
--=20
Ren=E9 Berber


--
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/

