Rom Lemarchand | 367297c | 2013-06-05 13:25:12 -0700 | [diff] [blame] | 1 | #include <stdio.h> |
2 | #include <unistd.h> | ||||
Rom Lemarchand | 367297c | 2013-06-05 13:25:12 -0700 | [diff] [blame] | 3 | #include <sys/swap.h> |
4 | |||||
5 | int swapoff_main(int argc, char **argv) | ||||
6 | { | ||||
7 | int err = 0; | ||||
8 | |||||
9 | if (argc != 2) { | ||||
10 | fprintf(stderr, "Usage: %s <filename>\n", argv[0]); | ||||
11 | return -EINVAL; | ||||
12 | } | ||||
13 | |||||
14 | err = swapoff(argv[1]); | ||||
15 | if (err) { | ||||
16 | fprintf(stderr, "swapoff failed for %s\n", argv[1]); | ||||
17 | } | ||||
18 | |||||
19 | return err; | ||||
20 | } |