public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* Re: Re: 1.3.2-1: mmap and MAP_PRIVATE|MAP_FIXED|MAP_ANON
@ 2001-09-18  4:28 Kandziora Jan
  2001-09-18  9:03 ` Corinna Vinschen
  0 siblings, 1 reply; 2+ messages in thread
From: Kandziora Jan @ 2001-09-18  4:28 UTC (permalink / raw)
  To: 'cygwin@cygwin.com'

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Re: 1.3.2-1: mmap and MAP_PRIVATE|MAP_FIXED|MAP_ANON
  2001-09-18  4:28 Re: 1.3.2-1: mmap and MAP_PRIVATE|MAP_FIXED|MAP_ANON Kandziora Jan
@ 2001-09-18  9:03 ` Corinna Vinschen
  0 siblings, 0 replies; 2+ messages in thread
From: Corinna Vinschen @ 2001-09-18  9:03 UTC (permalink / raw)
  To: 'cygwin@cygwin.com'

On Tue, Sep 18, 2001 at 01:28:48PM +0200, Kandziora Jan wrote:
> >
> >> 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.

Ok, I figured out what's going wrong.  A fix will be in the next
developers snapshot.

Thanks,
Corinna

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

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2001-09-18  9:03 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-09-18  4:28 Re: 1.3.2-1: mmap and MAP_PRIVATE|MAP_FIXED|MAP_ANON Kandziora Jan
2001-09-18  9:03 ` Corinna Vinschen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).