Commit 028998c5 authored by Andrew Vagin's avatar Andrew Vagin Committed by Pavel Emelyanov

proc_parse: parse pending signals

It's required to check the SIGSTOP signal, which can't be blocked.
Signed-off-by: 's avatarAndrew Vagin <avagin@virtuozzo.com>
Signed-off-by: 's avatarPavel Emelyanov <xemul@parallels.com>
parent 61b8fc26
...@@ -92,6 +92,7 @@ struct proc_status_creds { ...@@ -92,6 +92,7 @@ struct proc_status_creds {
char state; char state;
int ppid; int ppid;
unsigned long long sigpnd;
int seccomp_mode; int seccomp_mode;
u32 last_filter; u32 last_filter;
......
...@@ -765,10 +765,12 @@ int parse_pid_status(pid_t pid, struct proc_status_creds *cr) ...@@ -765,10 +765,12 @@ int parse_pid_status(pid_t pid, struct proc_status_creds *cr)
return -1; return -1;
} }
cr->sigpnd = 0;
if (bfdopenr(&f)) if (bfdopenr(&f))
return -1; return -1;
while (done < 9) { while (done < 11) {
str = breadline(&f); str = breadline(&f);
if (str == NULL) if (str == NULL)
break; break;
...@@ -846,9 +848,20 @@ int parse_pid_status(pid_t pid, struct proc_status_creds *cr) ...@@ -846,9 +848,20 @@ int parse_pid_status(pid_t pid, struct proc_status_creds *cr)
done++; done++;
continue; continue;
} }
if (!strncmp(str, "SigPnd:", 7) || !strncmp(str, "ShdPnd:", 7)) {
unsigned long long sigpnd;
if (sscanf(str + 7, "%llx", &sigpnd) != 1)
goto err_parse;
cr->sigpnd |= sigpnd;
done++;
continue;
}
} }
if (done >= 8) if (done >= 10)
ret = 0; ret = 0;
err_parse: err_parse:
......
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