summaryrefslogtreecommitdiffstats
path: root/disk-utils/mkswap.c
diff options
context:
space:
mode:
authormaximilian attems2008-07-30 11:46:32 +0200
committerKarel Zak2008-07-30 13:26:58 +0200
commitd144727bc3e5f77692fc2d6b5c1dbf5d05fc495c (patch)
tree6d0e94d31cc05862eb171216a73e9c917a63cd0b /disk-utils/mkswap.c
parentmount: retry on ENOMEDIUM (diff)
downloadkernel-qcow2-util-linux-d144727bc3e5f77692fc2d6b5c1dbf5d05fc495c.tar.gz
kernel-qcow2-util-linux-d144727bc3e5f77692fc2d6b5c1dbf5d05fc495c.tar.xz
kernel-qcow2-util-linux-d144727bc3e5f77692fc2d6b5c1dbf5d05fc495c.zip
use getpagesize()
getpagesize() is said to be more portable than sysconf(_SC_PAGESIZE) to anything Linux. this patch helps klibc porting effort as the sysconf multiplex API is not supported there. also remove comment of the switch to sysconf in mkswap.c. Signed-off-by: maximilian attems <max@stro.at>
Diffstat (limited to 'disk-utils/mkswap.c')
-rw-r--r--disk-utils/mkswap.c6
1 files changed, 1 insertions, 5 deletions
diff --git a/disk-utils/mkswap.c b/disk-utils/mkswap.c
index f7dbdf399..9d1ca3d59 100644
--- a/disk-utils/mkswap.c
+++ b/disk-utils/mkswap.c
@@ -132,10 +132,6 @@ is_sparc64(void) {
*
* What to do? Let us allow the user to specify the pagesize explicitly.
*
- * Update 05-Feb-2007 (kzak):
- * - use sysconf(_SC_PAGESIZE) to be consistent with the rest of
- * util-linux code. It is the standardized and preferred way of
- * querying page size.
*/
static int user_pagesize;
static int pagesize;
@@ -145,7 +141,7 @@ struct swap_header_v1 *p;
static void
init_signature_page(void) {
- int kernel_pagesize = pagesize = (int) sysconf(_SC_PAGESIZE);
+ int kernel_pagesize = pagesize = getpagesize();
if (user_pagesize) {
if ((user_pagesize & (user_pagesize-1)) ||