From bce3df9cc68cd0b4286f433ef4e3a52f978ad49a Mon Sep 17 00:00:00 2001 From: Doug MacEachern Date: Tue, 13 Sep 2005 00:40:39 +0000 Subject: [PATCH] proc_args test --- exp/sigar_proc_args.c | 50 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 exp/sigar_proc_args.c diff --git a/exp/sigar_proc_args.c b/exp/sigar_proc_args.c new file mode 100644 index 00000000..83603bb1 --- /dev/null +++ b/exp/sigar_proc_args.c @@ -0,0 +1,50 @@ +#include +#include +/* +gcc -g -o sigar_proc_args -lsocket \ +-L ../bindings/java/sigar-bin/lib -lsigar-sparc-sun-solaris-2.x \ +-I ../include sigar_proc_args.c +*/ +int main(int argc, char **argv) +{ + sigar_t *sigar; + sigar_proc_list_t procs; + sigar_proc_args_t args; + int n; + + if (sigar_open(&sigar) != SIGAR_OK) { + fprintf(stderr, "Error opening sigar!\n"); + return -1; + } + + sigar_proc_list_get(sigar, &procs); + + for (n=0; n