summaryrefslogtreecommitdiff
path: root/main.c
diff options
context:
space:
mode:
authorJeremie Koenig <jk@jk.fr.eu.org>2010-08-23 07:35:59 +0000
committerJeremie Koenig <jk@jk.fr.eu.org>2010-08-30 14:29:52 +0200
commit25bad336ed7af83bfb78b2a3534fdf223554bfc0 (patch)
treecb2f086c56af47245f7932de4e5f3f549625ed0e /main.c
parentabd1ad000a2861b46df445888365678686e31bcb (diff)
Add a --compatible option
* main.c (argp_parser): Add --compatible, which sets the options required for compatibility with the procps tools.
Diffstat (limited to 'main.c')
-rw-r--r--main.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/main.c b/main.c
index fee4867..35d05c6 100644
--- a/main.c
+++ b/main.c
@@ -51,6 +51,12 @@ argp_parser (int key, char *arg, struct argp_state *state)
if (*endp || ! *arg || (signed) opt_kernel_pid < 0)
error (1, 0, "--kernel-process: PID must be a positive integer");
break;
+
+ case 'c':
+ opt_clk_tck = 100;
+ opt_stat_mode = 0444;
+ opt_fake_self = 1;
+ break;
}
return 0;
@@ -74,6 +80,9 @@ struct argp argp = {
{ "kernel-process", 'k', "PID", 0,
"Process identifier for the kernel, used to retreive its command line "
"(default: 2)" },
+ { "compatible", 'c', NULL, 0,
+ "Try to be compatible with the Linux procps utilities. "
+ "Currently equivalent to -h 100 -s 0444 -S 1." },
{}
},
.parser = argp_parser,