summaryrefslogtreecommitdiffstats
path: root/toolbox/swapoff.c
diff options
context:
space:
mode:
Diffstat (limited to 'toolbox/swapoff.c')
-rw-r--r--toolbox/swapoff.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/toolbox/swapoff.c b/toolbox/swapoff.c
new file mode 100644
index 0000000..8f14158
--- /dev/null
+++ b/toolbox/swapoff.c
@@ -0,0 +1,21 @@
+#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;
+}