From 3418007ed675c2ab8a9885bcd101752246f9c2d8 Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Fri, 10 Sep 2004 23:56:29 +0000 Subject: Update. 2004-09-10 Ulrich Drepper * nscd/nscd.c (pagesize_m1): New variable. (main): Initialize it. * nscd/nscd.h: Declare pagesize_m1. * nscd/hstcache.c: Pass correctly aligned address to msync. * nscd/grpcache.c: Likewise. * nscd/pwdcache.c: Likewise. --- nscd/grpcache.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'nscd/grpcache.c') diff --git a/nscd/grpcache.c b/nscd/grpcache.c index 7315eece61..d07693f1a4 100644 --- a/nscd/grpcache.c +++ b/nscd/grpcache.c @@ -291,8 +291,13 @@ cache_addgr (struct database_dyn *db, int fd, request_header *req, { /* If necessary, we also propagate the data to disk. */ if (db->persistent) - // XXX async OK? - msync (dataset, total + n, MS_ASYNC); + { + // XXX async OK? + uintptr_t pval = (uintptr_t) dataset & ~pagesize_m1; + msync ((void *) pval, + ((uintptr_t) dataset & pagesize_m1) + total + n, + MS_ASYNC); + } /* Now get the lock to safely insert the records. */ pthread_rwlock_rdlock (&db->lock); -- cgit v1.2.1