diff options
Diffstat (limited to 'examples/wd.c')
-rw-r--r-- | examples/wd.c | 35 |
1 files changed, 0 insertions, 35 deletions
diff --git a/examples/wd.c b/examples/wd.c deleted file mode 100644 index 353a4662..00000000 --- a/examples/wd.c +++ /dev/null @@ -1,35 +0,0 @@ -#include <glibtop.h> -#include <glibtop/procwd.h> - -#include <glib.h> -#include <unistd.h> - -int main(int argc, char **argv) -{ - pid_t pid; - glibtop_proc_wd buf; - char **dirs, **dir; - - if (argc < 2 || !(pid = strtoul(argv[1], NULL, 0))) - pid = getpid(); - - glibtop_init(); - - dirs = glibtop_get_proc_wd(&buf, pid); - - g_print("Process %u:\n" - " - root: '%s'\n" - " - exe: '%s'\n" - " - working directories:\n", - (unsigned)pid, buf.root, buf.exe); - - for (dir = dirs; *dir; ++dir) - g_print(" - '%s'\n", *dir); - - g_strfreev(dirs); - - glibtop_close(); - - return 0; -} - |