All of lore.kernel.org
 help / color / mirror / Atom feed
From: Alex Williamson <alex.williamson@hp.com>
To: julian@xensource.com
Cc: xen-devel <xen-devel@lists.xensource.com>
Subject: [PATCH] don't use PAGE_SIZE in userspace
Date: Tue, 19 Dec 2006 19:48:03 -0700	[thread overview]
Message-ID: <1166582883.5054.6.camel@bling> (raw)


   PAGE_SIZE is not a constant on all architectures, getpagesize()
should be used from userspace.  Thanks,

	Alex

Signed-off-by: Alex Williamson <alex.williamson@hp.com>
---

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());
 	if (qtruncate(fd, length, 0)!=0) {
 		DPRINTF("ERROR truncating file\n");
 		return -1;

             reply	other threads:[~2006-12-20  2:48 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-12-20  2:48 Alex Williamson [this message]
2006-12-20  3:26 ` [PATCH] don't use PAGE_SIZE in userspace Tony Breeds
2006-12-20  3:36   ` Alex Williamson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1166582883.5054.6.camel@bling \
    --to=alex.williamson@hp.com \
    --cc=julian@xensource.com \
    --cc=xen-devel@lists.xensource.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.