This is the mail archive of the cygwin@cygwin.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: 1.3.2-1: mmap and MAP_PRIVATE|MAP_FIXED|MAP_ANON


On Tue, Sep 18, 2001 at 11:02:22AM +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...

> 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 speci­
                  fied, 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.

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/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]