forked from checkpoint-restore/criu
-
Notifications
You must be signed in to change notification settings - Fork 0
/
fdinfo.h
58 lines (48 loc) · 1.23 KB
/
fdinfo.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
#ifndef __CR_FDINFO_H__
#define __CR_FDINFO_H__
#include "common/list.h"
#include "images/eventfd.pb-c.h"
#include "images/eventpoll.pb-c.h"
#include "images/signalfd.pb-c.h"
#include "images/fsnotify.pb-c.h"
#include "images/timerfd.pb-c.h"
struct inotify_wd_entry {
InotifyWdEntry e;
FhEntry f_handle;
struct list_head node;
};
struct fanotify_mark_entry {
FanotifyMarkEntry e;
FhEntry f_handle;
struct list_head node;
union {
FanotifyInodeMarkEntry ie;
FanotifyMountMarkEntry me;
};
};
struct eventpoll_tfd_entry {
EventpollTfdEntry e;
struct list_head node;
};
union fdinfo_entries {
EventfdFileEntry efd;
SignalfdEntry sfd;
struct inotify_wd_entry ify;
struct fanotify_mark_entry ffy;
struct eventpoll_tfd_entry epl;
TimerfdEntry tfy;
};
extern void free_inotify_wd_entry(union fdinfo_entries *e);
extern void free_fanotify_mark_entry(union fdinfo_entries *e);
extern void free_event_poll_entry(union fdinfo_entries *e);
struct fdinfo_common {
off64_t pos;
int flags;
int mnt_id;
int owner;
};
extern int parse_fdinfo(int fd, int type,
int (*cb)(union fdinfo_entries *e, void *arg), void *arg);
extern int parse_fdinfo_pid(int pid, int fd, int type,
int (*cb)(union fdinfo_entries *e, void *arg), void *arg);
#endif