History

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.

Amir Goldstein committed 8 years ago

Commit d0a6a871 parent bdd5a465 files · +13 −6Browse files

Showing the changes to include/uapi/linux (1 of 5 files). Show all

Unified · Split

include/uapi/linux/fanotify.h+3−0
@@ -40,6 +40,9 @@ · 39 unmodified lines
40#define FAN_UNLIMITED_MARKS 0x0000002040#define FAN_UNLIMITED_MARKS 0x00000020
41#define FAN_ENABLE_AUDIT 0x0000004041#define FAN_ENABLE_AUDIT 0x00000040
42 42
43/* Flags to determine fanotify event format */
44#define FAN_REPORT_TID 0x00000100 /* event->pid is thread id */
45
43/* Deprecated - do not use this in programs and do not add new flags here! */46/* Deprecated - do not use this in programs and do not add new flags here! */
44#define FAN_ALL_INIT_FLAGS (FAN_CLOEXEC | FAN_NONBLOCK | \47#define FAN_ALL_INIT_FLAGS (FAN_CLOEXEC | FAN_NONBLOCK | \
45 FAN_ALL_CLASS_BITS | FAN_UNLIMITED_QUEUE |\48 FAN_ALL_CLASS_BITS | FAN_UNLIMITED_QUEUE |\