Added new feature (proc_args) to get command line arguments:
typedef struct _glibtop_proc_args glibtop_proc_args; struct _glibtop_proc_args { u_int64_t flags, size; /* GLIBTOP_PROC_ARGS_SIZE */ }; Returns a string containing all command line arguments of the process, the `unsigned' parameter is the maximum length of this string; if it is zero then no limit will be set. extern const char *glibtop_get_proc_args_l __P((glibtop *, glibtop_proc_args *, pid_t, unsigned));
This commit is contained in:
@@ -29,6 +29,7 @@ handle_parent_connection (int s)
|
||||
glibtop_command _cmnd, *cmnd = &_cmnd;
|
||||
glibtop_mountentry *mount_list;
|
||||
char parameter [BUFSIZ];
|
||||
unsigned short device;
|
||||
int64_t *param_ptr;
|
||||
int all_fs;
|
||||
pid_t pid;
|
||||
@@ -193,7 +194,7 @@ handle_parent_connection (int s)
|
||||
do_output (s, resp, _offset_data (proc_segment), 0, NULL);
|
||||
break;
|
||||
case GLIBTOP_CMND_MOUNTLIST:
|
||||
memcpy (&all_fs, parameter, sizeof (all_fs));
|
||||
memcpy (&all_fs, parameter, sizeof (all_fs));
|
||||
mount_list = glibtop_get_mountlist_l
|
||||
(server, &resp->u.data.mountlist, all_fs);
|
||||
do_output (s, resp, _offset_data (mountlist),
|
||||
@@ -206,6 +207,12 @@ handle_parent_connection (int s)
|
||||
do_output (s, resp, _offset_data (fsusage),
|
||||
0, NULL);
|
||||
break;
|
||||
case GLIBTOP_CMND_PPP:
|
||||
memcpy (&device, parameter, sizeof (device));
|
||||
glibtop_get_ppp_l
|
||||
(server, &resp->u.data.ppp, device);
|
||||
do_output (s, resp, _offset_data (ppp), 0, NULL);
|
||||
break;
|
||||
default:
|
||||
glibtop_warn ("Parent received unknown command %u",
|
||||
cmnd->command);
|
||||
|
Reference in New Issue
Block a user