Article View: news.software.nntp
Article #15704Re: patch for nnrpd 1.5.1 to mmap .overview files
From: Matt Dillon
Date: Mon, 10 Mar 1997 00:00
Date: Mon, 10 Mar 1997 00:00
32 lines
1887 bytes
1887 bytes
:In article <5g0pba$dot$1@news.demos.su>,
:Andrew A. Vasilyev <andy@snm.demos.su> wrote:
:>In news.software.nntp Clayton O'Neill <coneill@oneill.net> wrote:
:>CO>Am I missing something? Why would we even bother to try to page align the
:>CO>end? I don't know of any OS's that require that, and I know that Linux and
:>
:> It was the 3-rd question I had not asked :)) And simply mmap()
:> (file_size + 1) - but probably one byte also is not necessary? :))
:>
:>CO>Solaris don't. BTW, I've also written code to mmap the overview, but my
:>________
:> ANDY
Warning warning will robinson!
Many operating systems do not allow you to mmap() a file beyond it's
logical end-of-file. If the file size falls on a page boundry, and you
try to mmap(..., size + 1, ...), many OS's will not allow it and mmap()
will return an error.
I believe FreeBSD and linux allow you to map beyond the EOF. IRIX
most definitely does *NOT*, however. I don't know about SunOs.
The insidiousness of the problem is that if the file's size does not
fall on a page boundry, mmap() will often be successful, so many
programmers do not spot the problem immediately.
-Matt
Technical Details
Message-ID:
<5g1u60$q41@flea.best.net>Path:
mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.nntp.mbox.zip!not-for-mailReferences:
<331EE55D.1493@cwix.net> <5fv1s9$8ki$1@news.demos.su> <slrn5i7kg8.4gs.coneill@blah.erols.com> <5g0pba$dot$1@news.demos.su>Show Full Headers
Complete Article Headers
Message-ID: <5g1u60$q41@flea.best.net> Subject: Re: patch for nnrpd 1.5.1 to mmap .overview files Date: Mon, 10 Mar 1997 00:00:00 +0000 From: dillon@flea.best.net (Matt Dillon) References: <331EE55D.1493@cwix.net> <5fv1s9$8ki$1@news.demos.su> <slrn5i7kg8.4gs.coneill@blah.erols.com> <5g0pba$dot$1@news.demos.su> Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.nntp.mbox.zip!not-for-mail X-Deja-AN: 224488772 Organization: BEST Internet Communications, Inc. Newsgroups: news.software.nntp