delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2003/07/03/06:01:50

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sources.redhat.com/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
Date: Thu, 3 Jul 2003 12:01:29 +0200
From: Corinna Vinschen <corinna-cygwin AT cygwin DOT com>
To: cygwin AT cygwin DOT com
Subject: Re: mmap() and gcc precompiled headers
Message-ID: <20030703100129.GD22232@cygbert.vinschen.de>
Reply-To: cygwin AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
References: <3F034280 DOT 6070908 AT agilent DOT com> <20030703094728 DOT GC22232 AT cygbert DOT vinschen DOT de>
Mime-Version: 1.0
In-Reply-To: <20030703094728.GC22232@cygbert.vinschen.de>
User-Agent: Mutt/1.4.1i

On Thu, Jul 03, 2003 at 11:47:28AM +0200, Corinna Vinschen wrote:
> On Wed, Jul 02, 2003 at 01:37:20PM -0700, Earl Chew wrote:
> > From the FreeBSD man page:
> > 
> >     If addr is non-zero, it is used as a hint to the system.  (As a
> >     convenience to the system, the actual address of the region may
> >     differ from the address supplied.) If addr is zero, an address will
> >     be selected by the system.

SUSv3 puts it like this:

  When MAP_FIXED is not set, the implementation uses addr in an
  implementation-defined manner to arrive at pa. The pa so chosen
  shall be an area of the address space that the implementation
  deems suitable for a mapping of len bytes to the file. [...]
  A non-zero value of addr is taken to be a suggestion of a process
  address near which the mapping should be placed.

`pa' is the result returned from mmap.  It's very important to emphasize
on "implementation-defined".  Again, if gcc relies on getting a map at
the same address without using MAP_FIXED, it's a bug in gcc. 

Therefore it would be "nice" to implement mmap64() as you suggested but
it will not exactly solve the problem.  Keep the following in mind:  On
9x as well as on NT systems, the returned address is the lowest address
possible to return inside the shared memory area.  That means, if you
realign addr to the next lower 64k boundary and use this in a call to
MapViewOfFileEx, that raises the chance to collide with a former still
active mapping.  I don't see that there's a really good solution.


Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Developer                                mailto:cygwin AT cygwin DOT com
Red Hat, Inc.

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

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019