diff options
Diffstat (limited to 'bin/set_rt_mode.c')
-rw-r--r-- | bin/set_rt_mode.c | 46 |
1 files changed, 0 insertions, 46 deletions
diff --git a/bin/set_rt_mode.c b/bin/set_rt_mode.c deleted file mode 100644 index 510da70..0000000 --- a/bin/set_rt_mode.c +++ /dev/null | |||
@@ -1,46 +0,0 @@ | |||
1 | #include <stdio.h> | ||
2 | #include <strings.h> | ||
3 | #include <stdlib.h> | ||
4 | #include <string.h> | ||
5 | #include <errno.h> | ||
6 | |||
7 | #include "litmus.h" | ||
8 | |||
9 | |||
10 | void die(const char* str) | ||
11 | { | ||
12 | fprintf(stderr, "%s\n%s\n", str, | ||
13 | "Usage: set_rt_mode [-v] {on|off}"); | ||
14 | exit(127); | ||
15 | } | ||
16 | |||
17 | int main(int argc, char** argv) | ||
18 | { | ||
19 | int ret; | ||
20 | int verbose = 0; | ||
21 | char* cmd = argv[1]; | ||
22 | |||
23 | if (argc == 3 && !strcmp(argv[1], "-v")) { | ||
24 | verbose = 1; | ||
25 | cmd = argv[2]; | ||
26 | } | ||
27 | if (argc == 2 || verbose) { | ||
28 | if (!strcmp(cmd, "on")) { | ||
29 | if (verbose) | ||
30 | printf("Enabling real-time mode.\n"); | ||
31 | ret = set_rt_mode(MODE_RT_RUN); | ||
32 | if (ret && verbose) | ||
33 | perror("set_rt_mode failed"); | ||
34 | exit(ret ? errno : 0); | ||
35 | } else if (!strcmp(cmd, "off")) { | ||
36 | if (verbose) | ||
37 | printf("Disabling real-time mode.\n"); | ||
38 | ret = set_rt_mode(MODE_NON_RT); | ||
39 | if (ret && verbose) | ||
40 | perror("set_rt_mode failed"); | ||
41 | exit(ret ? errno : 0); | ||
42 | } | ||
43 | } | ||
44 | die("Bad arguments."); | ||
45 | return 0; | ||
46 | } | ||