From 98c526c90819cb8f21bcee90bbe93e859a79ae16 Mon Sep 17 00:00:00 2001 From: phk Date: Fri, 7 Mar 2008 11:04:51 +0000 Subject: [PATCH] Attempt to mlock(2) SHMFILE in core. git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@2558 d4fa192b-c00b-0410-8231-f00ffab90ce4 --- varnish-cache/bin/varnishd/shmlog.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/varnish-cache/bin/varnishd/shmlog.c b/varnish-cache/bin/varnishd/shmlog.c index 2abbe326..18a48e77 100644 --- a/varnish-cache/bin/varnishd/shmlog.c +++ b/varnish-cache/bin/varnishd/shmlog.c @@ -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; -- 2.39.5