Commit 8097a8dc authored by Pavel Emelyanov's avatar Pavel Emelyanov

signalfd: Add proc fdinfo parsing facility

Signed-off-by: 's avatarPavel Emelyanov <xemul@parallels.com>
parent 04016641
...@@ -8,6 +8,7 @@ ...@@ -8,6 +8,7 @@
#include "../protobuf/eventfd.pb-c.h" #include "../protobuf/eventfd.pb-c.h"
#include "../protobuf/eventpoll.pb-c.h" #include "../protobuf/eventpoll.pb-c.h"
#include "../protobuf/signalfd.pb-c.h"
#include "../protobuf/inotify.pb-c.h" #include "../protobuf/inotify.pb-c.h"
#define PROC_TASK_COMM_LEN 32 #define PROC_TASK_COMM_LEN 32
...@@ -124,6 +125,7 @@ extern int parse_pid_status(pid_t pid, struct proc_status_creds *); ...@@ -124,6 +125,7 @@ extern int parse_pid_status(pid_t pid, struct proc_status_creds *);
union fdinfo_entries { union fdinfo_entries {
EventfdFileEntry efd; EventfdFileEntry efd;
EventpollTfdEntry epl; EventpollTfdEntry epl;
SignalfdEntry sfd;
InotifyWdEntry ify; InotifyWdEntry ify;
}; };
......
...@@ -762,6 +762,22 @@ int parse_fdinfo(int fd, int type, ...@@ -762,6 +762,22 @@ int parse_fdinfo(int fd, int type,
entry_met = true; entry_met = true;
continue; continue;
} }
if (fdinfo_field(str, "sigmask")) {
signalfd_entry__init(&entry.sfd);
if (type != FD_TYPES__SIGNALFD)
goto parse_err;
ret = sscanf(str, "sigmask: %Lx",
(unsigned long long *)&entry.sfd.sigmask);
if (ret != 1)
goto parse_err;
ret = cb(&entry, arg);
if (ret)
return ret;
entry_met = true;
continue;
}
if (fdinfo_field(str, "inotify wd")) { if (fdinfo_field(str, "inotify wd")) {
FhEntry f_handle = FH_ENTRY__INIT; FhEntry f_handle = FH_ENTRY__INIT;
int hoff; int hoff;
......
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