🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.nntp
Article #10409

ACT_STYLE = MMAP on HPUX 10.10 with INN 1.4 (with possible solution)

#10409
From: Chris Dent
Date: Mon, 26 Aug 1996 00:00
55 lines
2266 bytes

I decided I wanted to use MMAP for ACT_STYLE on our new HPUX 10.10
INN 1.4unoff4 server. At first it did not work correctly, the active
file was not updated frequently enough.

So I checked the FAQ and found this:

  froh@devnull.franken.de (Frohwalt Egerer) writes:

  In the source look for the place where INN would write the active file
  back to disk if MMAP was turned off. At that place I added a 'msync()'
  to the 'MMAP' branch to make it work on my university's HPs.

I modified $INN/innd/icd.c as follows:

<code snippet>
void
ICDwriteactive()
{
#if     defined(ACT_MMAP)
    /* add an msync here to see if we can get the server doing
       the right thing. We hope these are the right args */
    if(msync(ICDactpointer, ICDactsize, MS_ASYNC) == EINVAL) {
       syslog(L_FATAL, "%s cant msync %s %m", LogName, ICDactpath);
       exit(1);
    }
#else

    if (lseek(ICDactfd, 0L, SEEK_SET) == -1) {
        syslog(L_FATAL, "%s cant rewind %s %m", LogName, ICDactpath);
        exit(1);
    }
    if (xwrite(ICDactfd, ICDactpointer, ICDactsize) < 0) {
        syslog(L_FATAL, "%s cant write %s %m", LogName, ICDactpath);
        exit(1);
    }
#endif  /* defined(ACT_MMAP) */
}
</end of code snippet>

My question is this: Is the addition of the msync() the correct thing to 
do. If it is, is the way I've done it correct?

It appears to be working correctly (active file updates are happening 
as expected).

If this is correct this seems like something that might be helpful in
the FAQ.

Thanks for any input.
-- 
Chris Dent <cdent@indiana.edu> http://detritus.ucs.indiana.edu/~cdent/

Technical Details
Message-ID: <4vtav9$num@dismay.ucs.indiana.edu>
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

Show Full Headers
Complete Article Headers
Message-ID: <4vtav9$num@dismay.ucs.indiana.edu>
Subject: ACT_STYLE = MMAP on HPUX 10.10 with INN 1.4 (with possible solution)
Date: Mon, 26 Aug 1996 00:00:00 +0000
From: cdent@ezinfo.ucs.indiana.edu (Chris Dent)
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: 176644237
Distribution: inet
Organization: HBC/CJD
Keywords: HPUX MMAP msync
Newsgroups: news.software.nntp
Summary: Will this solution work