]> err.no Git - varnish/commitdiff
Attempt to mlock(2) SHMFILE in core.
authorphk <phk@d4fa192b-c00b-0410-8231-f00ffab90ce4>
Fri, 7 Mar 2008 11:04:51 +0000 (11:04 +0000)
committerphk <phk@d4fa192b-c00b-0410-8231-f00ffab90ce4>
Fri, 7 Mar 2008 11:04:51 +0000 (11:04 +0000)
git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@2558 d4fa192b-c00b-0410-8231-f00ffab90ce4

varnish-cache/bin/varnishd/shmlog.c

index 2abbe32640091d5a4c9d64fa25ccf96587230a86..18a48e775d159322e402beeadc8108e681bddd2e 100644 (file)
@@ -347,6 +347,10 @@ VSL_MgtInit(const char *fn, unsigned size)
            MAP_HASSEMAPHORE | MAP_NOSYNC | MAP_SHARED,
            heritage.vsl_fd, 0);
        xxxassert(loghead != MAP_FAILED);
+       i = mlock(loghead, heritage.vsl_size);
+       if (i != 0)
+               fprintf(stderr, "Notice: locking SHMFILE in core failed: %s\n",
+                   strerror(errno));
        VSL_stats = &loghead->stats;
        pp = (void *)(loghead + 1);
        *pp = *params;