1
/* $Id: swap.c 61 2006-05-19 18:32:14Z steve-beattie $ */
4
* Copyright (C) 2002-2005 Novell/SUSE
6
* This program is free software; you can redistribute it and/or
7
* modify it under the terms of the GNU General Public License as
8
* published by the Free Software Foundation, version 2 of the
15
#include <sys/types.h>
20
int main(int argc, char *argv[])
23
fprintf(stderr, "usage: %s [on|off] swapfile\n",
28
if (strcmp(argv[1], "on") == 0) {
29
if (swapon(argv[2], 0) == -1) {
30
fprintf(stderr, "FAIL: swapon %s failed - %s\n",
35
} else if (strcmp(argv[1], "off") == 0) {
36
if (swapoff(argv[2]) == -1) {
37
fprintf(stderr, "FAIL: swapoff %s failed - %s\n",
43
fprintf(stderr, "usage: %s [on|off] swapfile\n",