fanotify: support reporting thread id instead of process id
In order to identify which thread triggered the event in a multi-threaded program, add the FAN_REPORT_TID flag in fanotify_init to opt-in for reporting the event creator's thread id information. Signed-off-by: nixiaoming <nixiaoming@huawei.com> Signed-off-by: Amir Goldstein <amir73il@gmail.com> Signed-off-by: Jan Kara <jack@suse.cz>
This commit is contained in:
@@ -40,6 +40,9 @@
|
||||
#define FAN_UNLIMITED_MARKS 0x00000020
|
||||
#define FAN_ENABLE_AUDIT 0x00000040
|
||||
|
||||
/* Flags to determine fanotify event format */
|
||||
#define FAN_REPORT_TID 0x00000100 /* event->pid is thread id */
|
||||
|
||||
/* Deprecated - do not use this in programs and do not add new flags here! */
|
||||
#define FAN_ALL_INIT_FLAGS (FAN_CLOEXEC | FAN_NONBLOCK | \
|
||||
FAN_ALL_CLASS_BITS | FAN_UNLIMITED_QUEUE |\
|
||||
|
Reference in New Issue
Block a user