Skip to content

Commit

Permalink
core: pt - helper function to get description for current process
Browse files Browse the repository at this point in the history
  • Loading branch information
miconda committed Jan 2, 2018
1 parent 571c999 commit 5c4309e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/core/pt.c
Expand Up @@ -195,6 +195,12 @@ int my_pid()
}


/* return processes description */
char* my_desc(void)
{
return pt ? pt[process_no].desc : "unknown";
}


/* close unneeded sockets */
int close_extra_socks(int child_id, int proc_no)
Expand Down
3 changes: 3 additions & 0 deletions src/core/pt.h
Expand Up @@ -64,6 +64,9 @@ int close_extra_socks(int proc_id, int proc_no);
/* return processes pid */
int my_pid(void);

/* return processes description */
char* my_desc(void);

/**
* Forks a new process.
* @param desc - text description for the process table
Expand Down

0 comments on commit 5c4309e

Please sign in to comment.