platform_system_core/toolbox/swapoff.c
Rom Lemarchand 367297c3d7 toolbox: swap utils
Add swap utilities (mkswap, swapon, swapoff) to the toolbox

Change-Id: If5ed6981670a1cdda6b528b587dbc1be7ccdf832
Signed-off-by: Rom Lemarchand <romlem@google.com>
2013-06-25 13:21:53 -07:00

21 lines
385 B
C

#include <stdio.h>
#include <unistd.h>
#include <asm/page.h>
#include <sys/swap.h>
int swapoff_main(int argc, char **argv)
{
int err = 0;
if (argc != 2) {
fprintf(stderr, "Usage: %s <filename>\n", argv[0]);
return -EINVAL;
}
err = swapoff(argv[1]);
if (err) {
fprintf(stderr, "swapoff failed for %s\n", argv[1]);
}
return err;
}