process_procfs_request: Add Pid to /proc/<PID>/status

The standard UNIX tool to get processes information, need to have the
process id inside /proc/<PID>/status.

Using ps without PID in /proc/<PID>/status gives :

  PID TTY          TIME CMD
 2551 pts/0    00:00:00 bash
    0 pts/0    00:00:00 exe
    0 pts/0    00:00:00 exe

With this patch:
  PID TTY          TIME CMD
 2551 pts/0    00:00:00 bash
11966 pts/0    00:00:00 exe
12619 pts/0    00:00:00 exe

Change-Id: Ic9d255cbef4d49e49bdaedcfc8e3545d9c144325
This commit is contained in:
Aurelien Cedeyn
2018-02-28 15:27:12 +01:00
committed by Dominique Martinet
parent 97273adcc5
commit 68c702d024

View File

@ -535,6 +535,7 @@ void process_procfs_request(struct ikc_scd_packet *rpacket)
else if (proc->status == PS_EXITED)
state = "Z (zombie)";
sprintf(tmp,
"Pid:\t%d\n"
"Uid:\t%d\t%d\t%d\t%d\n"
"Gid:\t%d\t%d\t%d\t%d\n"
"State:\t%s\n"
@ -543,6 +544,7 @@ void process_procfs_request(struct ikc_scd_packet *rpacket)
"Cpus_allowed_list:\t%s\n"
"Mems_allowed:\t%s\n"
"Mems_allowed_list:\t%s\n",
proc->pid,
proc->ruid, proc->euid, proc->suid, proc->fsuid,
proc->rgid, proc->egid, proc->sgid, proc->fsgid,
state,