Commit 6ed9f872 authored by Pavel Emelyanov's avatar Pavel Emelyanov

proc: Make small stat parsing read pgid and sid

They are just two next in this file, so extend. This is
required for pgid/sid early read, see next patches for
details.
Signed-off-by: 's avatarPavel Emelyanov <xemul@parallels.com>
parent 2a0c526b
...@@ -14,6 +14,8 @@ struct proc_pid_stat_small { ...@@ -14,6 +14,8 @@ struct proc_pid_stat_small {
char comm[PROC_TASK_COMM_LEN]; char comm[PROC_TASK_COMM_LEN];
char state; char state;
int ppid; int ppid;
int pgid;
int sid;
}; };
struct proc_pid_stat { struct proc_pid_stat {
......
...@@ -195,10 +195,10 @@ int parse_pid_stat_small(pid_t pid, struct proc_pid_stat_small *s) ...@@ -195,10 +195,10 @@ int parse_pid_stat_small(pid_t pid, struct proc_pid_stat_small *s)
return -1; return -1;
memset(s, 0, sizeof(*s)); memset(s, 0, sizeof(*s));
n = fscanf(f, "%d " PROC_TASK_COMM_LEN_FMT " %c %d", n = fscanf(f, "%d " PROC_TASK_COMM_LEN_FMT " %c %d %d %d",
&s->pid, s->comm, &s->state, &s->ppid); &s->pid, s->comm, &s->state, &s->ppid, &s->pgid, &s->sid);
if (n < 4) { if (n < 6) {
pr_err("Parsing %d's stat failed (#fields do not match)\n", pid); pr_err("Parsing %d's stat failed (#fields do not match)\n", pid);
return -1; return -1;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment