Added support for command line arguments (glibtop_proc_args).

This commit is contained in:
Martin Baulig
1999-04-03 17:07:09 +00:00
parent 885045ca55
commit 5b946cb261
3 changed files with 60 additions and 3 deletions

View File

@@ -146,3 +146,18 @@ glibtop_get_proc_data_proc_kernel_s (glibtop *server,
return 0;
}
int
glibtop_get_proc_data_proc_args_s (glibtop *server, pid_t pid,
char *result, size_t max_len)
{
int name [3] = { CTL_LIBGTOP, LIBGTOP_PROC_ARGS, pid };
size_t size = max_len;
if (sysctl (name, 3, result, &size, NULL, 0)) {
glibtop_warn_io_r (server, "sysctl (libgtop/proc_args)");
return -1;
}
return size;
}