aboutsummaryrefslogtreecommitdiff
path: root/toys/mkswap.c
diff options
context:
space:
mode:
Diffstat (limited to 'toys/mkswap.c')
-rw-r--r--toys/mkswap.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/toys/mkswap.c b/toys/mkswap.c
index 43fb6bfb..87c1550f 100644
--- a/toys/mkswap.c
+++ b/toys/mkswap.c
@@ -21,7 +21,7 @@ config MKSWAP
void mkswap_main(void)
{
- int fd = xopen(*toys.optargs, O_RDWR), pagesize = getpagesize();
+ int fd = xopen(*toys.optargs, O_RDWR), pagesize = sysconf(_SC_PAGE_SIZE);
off_t len = fdlength(fd);
unsigned int pages = (len/pagesize)-1, *swap = (unsigned int *)toybuf;