From mboxrd@z Thu Jan 1 00:00:00 1970 From: Tony Breeds Subject: Re: [PATCH] don't use PAGE_SIZE in userspace Date: Wed, 20 Dec 2006 14:26:45 +1100 Message-ID: <20061220032645.GB27551@bakeyournoodle.com> References: <1166582883.5054.6.camel@bling> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Content-Disposition: inline In-Reply-To: <1166582883.5054.6.camel@bling> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Alex Williamson Cc: xen-devel , julian@xensource.com List-Id: xen-devel@lists.xenproject.org On Tue, Dec 19, 2006 at 07:48:03PM -0700, Alex Williamson wrote: > > PAGE_SIZE is not a constant on all architectures, getpagesize() > should be used from userspace. Thanks, > > Alex > > Signed-off-by: Alex Williamson > --- > > diff -r 381f119b15a0 tools/blktap/drivers/block-qcow.c > --- a/tools/blktap/drivers/block-qcow.c Tue Dec 19 21:33:12 2006 +0000 > +++ b/tools/blktap/drivers/block-qcow.c Tue Dec 19 19:41:01 2006 -0700 > @@ -1353,7 +1353,8 @@ int qcow_create(const char *filename, ui > free(ptr); > > /*adjust file length to 4 KByte boundary*/ > - length = ROUNDUP(header_size + (l1_size * sizeof(uint64_t)),PAGE_SIZE); > + length = ROUNDUP(header_size + (l1_size * sizeof(uint64_t)), > + getpagesize()); How about updateing the comment above, aswell? Yours Tony linux.conf.au http://linux.conf.au/ || http://lca2007.linux.org.au/ Jan 15-20 2007 The Australian Linux Technical Conference!