* .cvsignore: * Makefile.am: * proclist.c: (main): * procmap.c: (main): Added quick example for glibtop_get_proclist() and updated procmap example to display smap.
29 lines
345 B
C
29 lines
345 B
C
#include <glibtop.h>
|
|
#include <glibtop/proclist.h>
|
|
|
|
#include <glib.h>
|
|
|
|
#include <stdio.h>
|
|
|
|
int main()
|
|
{
|
|
unsigned *pids;
|
|
unsigned i;
|
|
glibtop_proclist buf;
|
|
|
|
glibtop_init();
|
|
|
|
pids = glibtop_get_proclist(&buf, 0, 0);
|
|
|
|
for (i = 0; i < buf.number; ++i)
|
|
printf("%u ", pids[i]);
|
|
|
|
putchar('\n');
|
|
|
|
g_free(pids);
|
|
|
|
glibtop_close();
|
|
|
|
return 0;
|
|
}
|