why msync() is not quoted by MMAP_NEED_MSYNC?

Russ Allbery rra at stanford.edu
Fri Jan 2 22:31:17 UTC 2004


Katsuhiro Kondou <Katsuhiro_Kondou at isc.org> writes:
> Russ Allbery <rra at stanford.edu> wrote;

> } msync needs to be called with page-aligned addresses.  Some parts of INN
> } weren't doing that; I don't know if icd.c has that problem.  If so, the
> } msync_page function may help.

> icd.c doesn't take care of it, but OSX's page size is 4K which I
> verified by getpagesize(), and actual address when I got the error was
> 0x1aa000.

How about the length, though?  Both the starting pointer *and* the length
passed to msync have to be page-aligned (the man page tends to be fairly
bad at explaining this).  If it's just using the length of the active file
itself, it may not be.

It should always be safe to replace msync with msync_page (and we should
probably do that everywhere).  I'm wondering if that would help.

-- 
Russ Allbery (rra at stanford.edu)             <http://www.eyrie.org/~eagle/>

    Please send questions to the list rather than mailing me directly.
     <http://www.eyrie.org/~eagle/faqs/questions.html> explains why.


More information about the inn-workers mailing list