This is the mail archive of the 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]
Other format: [Raw text]

Re: msync patch

On Mon, Mar 11, 2002 at 06:07:03PM -0000, Chris January wrote:
> This patch modifies msync in so that you can call msync with an
> address which occurs in the middle of an mmap'ed region. It also fixes the
> bug where the address in the relevant mmap_record would not match the one
> passed to msync if the offset of the mmap'ed region within the file was not
> on a dwAllocationGranularity boundary.

First I was inclined to refuse the patch since SUSv2 requires
`addr' to be a multiple of getpagesize() but POSIX doesn't
so it's better trying to be POSIX compliant here.

However, the patch only checks the beginning and the end of the
given address range but the address range could span over a
non-mapped region which is a fault from msync's point of view.

I've checked in a slightly different version which uses a method
I implemented today.  msync() now tests if the whole address range
is contigeously mmap'd, returning ENOMEM otherwise.

I'd appreciate if you could give it a try.


Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Developer                      
Red Hat, Inc.

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