delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2001/09/18/07:29:30

Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT sources DOT redhat DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT sources DOT redhat DOT com>
List-Help: <mailto:cygwin-help AT sources DOT redhat DOT com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner AT sources DOT redhat DOT com
Delivered-To: mailing list cygwin AT sources DOT redhat DOT com
Message-ID: <F536EC3453B2D411AD6100508BAF5F9901FAB3FD@bwga521a.ts.siemens.de>
From: Kandziora Jan <Jan DOT Kandziora AT ts DOT siemens DOT de>
To: "'cygwin AT cygwin DOT com'" <cygwin AT cygwin DOT com>
Subject: Re: Re: 1.3.2-1: mmap and MAP_PRIVATE|MAP_FIXED|MAP_ANON
Date: Tue, 18 Sep 2001 13:28:48 +0200
MIME-Version: 1.0
X-Mailer: Internet Mail Service (5.5.2653.19)

>
>> if ((buf2=mmap((void*)0x70000000,1, > >
PROT_READ|PROT_WRITE,MAP_PRIVATE|MAP_FIXED|MAP_ANON,0,0))==NULL) 
>
^^^^ Hmm!
>$ man mmap [...]
	RETURN VALUE On success, mmap returns a pointer to the mapped area.
On error, MAP_FAILED (-1) is returned, and errno is set appropriately...

You are right. But it does *not* return MAP_FAILED, it returns 0x60001000,
which is a valid address.

>>
>> Is it impossible with windows to mmap a couple of anonymous areas
anywhere I
>> want and no memory is already mapped?
>>
>More or less. Windows is somewhat bulky in giving you the area you want.
However:
>$ man mmap [...] MAP_FIXED Do not select a different address than the one
specified.
>If the specified address cannot be used, mmap will fail. If MAP_FIXED is
specified, start must be a multiple of the pagesize. Use of this option is
discouraged.
>Note that. A normal application should have no need ever to desire a
specific address.

I do not write a normal application: It is a kind of executeable loader
which allow to specify the address the (special) executeable is loaded to.
The intention is to have exactly the same code of this special executables
running on a windows and on a linux box to make it possible to check the two
computers programs against each other at runtime.

	Jan


--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.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