summaryrefslogtreecommitdiff
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
commitc0e9dd6d3bcad339d8a263712997f0aaa89f236e (patch)
tree6302732e4d8f9e1c5e1ccc1d5ab34e334ac0e7d8
parent41c86b73e275b632e10fc81e2c4823472dedb89f (diff)
Add a --compatible option
* main.c (argp_parser): Add --compatible, which sets the options required for compatibility with the procps tools.
-rw-r--r--main.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/main.c b/main.c
index fee4867c..35d05c65 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,