summaryrefslogtreecommitdiffstats
path: root/toolbox/swapoff.c
blob: 8f141585063a545f3290d9e5b7010dd3cd17e5ad (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
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;
}