projects
/
xfstests-dev.git
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
history
|
raw
|
HEAD
generic: test invalid swap file activation
[xfstests-dev.git]
/
src
/
swapon.c
1
/* swapon(8) without any sanity checks; simply calls swapon(2) directly. */
2
3
#include <stdio.h>
4
#include <stdlib.h>
5
#include <unistd.h>
6
#include <sys/swap.h>
7
8
int main(int argc, char **argv)
9
{
10
int ret;
11
12
if (argc != 2) {
13
fprintf(stderr, "usage: %s PATH\n", argv[0]);
14
return EXIT_FAILURE;
15
}
16
17
ret = swapon(argv[1], 0);
18
if (ret) {
19
perror("swapon");
20
return EXIT_FAILURE;
21
}
22
23
return EXIT_SUCCESS;
24
}