Add -l option to show full command line (fixes #23)

This commit is contained in:
anomen
2016-06-13 22:22:51 +02:00
parent 276d648c33
commit 5e2c35700b
8 changed files with 107 additions and 17 deletions

View File

@@ -57,7 +57,7 @@ public:
/* the process makes a copy of the name. the device name needs to be stable.
*/
Process(const unsigned long m_inode, const char *m_devicename,
const char *m_name = NULL)
const char *m_name = NULL, const char *m_cmdline = NULL)
: inode(m_inode) {
// std::cout << "ARN: Process created with dev " << m_devicename <<
// std::endl;
@@ -69,6 +69,11 @@ public:
else
name = strdup(m_name);
if (m_cmdline == NULL)
cmdline = NULL;
else
cmdline = strdup(m_cmdline);
devicename = m_devicename;
connections = NULL;
pid = 0;
@@ -78,6 +83,7 @@ public:
~Process() {
free(name);
free(cmdline);
if (DEBUG)
std::cout << "PROC: Process deleted at " << this << std::endl;
}
@@ -90,6 +96,7 @@ public:
void gettotalb(float *recvd, float *sent);
char *name;
char *cmdline;
const char *devicename;
int pid;