This is the mail archive of the
mailing list for the Cygwin project.
Re: MMap offset parameter failing with ENOMEM error
- From: Corinna Vinschen <corinna-cygwin at cygwin dot com>
- To: "Cygwin at Cygwin dot Com" <cygwin at cygwin dot com>
- Date: Thu, 19 Sep 2002 09:32:39 +0200
- Subject: Re: MMap offset parameter failing with ENOMEM error
- References: <email@example.com>
- Reply-to: cygwin at cygwin dot com
On Thu, Sep 19, 2002 at 12:19:06PM +1000, Shane Mann wrote:
> I am having trouble with mmap using the last 'offset' parameter. I have
> attached a small piece of code (and sample file) which demonstrates the
> problem. Basically if the offset parameter is passed as a variable to mmap
> then the call fails with an ENOMEM error. But if you pass 0 as the parameter
> and then access the return address from mmap + offset - it is fine. My
> question: is mmap handling the offset parameter correctly?
> Usage for the program:
> ./a.exe <offset> <file> eg: ./a.exe 11200 index.idx
> To see the address + offset work, comment out the first mmap call and return
> statement and uncomment the lines below each one.
> Any help appreciated.
Your application tries to mmap over EOF.
Corinna Vinschen Please, send mails regarding Cygwin to
Cygwin Developer mailto:firstname.lastname@example.org
Red Hat, Inc.
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Bug reporting: http://cygwin.com/bugs.html