On Thu 04-10-18 00:25:38, Amir Goldstein wrote: > In order to identify which thread triggered the event in a > multi-threaded program, add the FAN_EVENT_INFO_TID flag in fanotify_init > to opt-in for reporting the event creator's thread id information. > > Signed-off-by: nixiaoming <nixiaoming@xxxxxxxxxx> > Signed-off-by: Amir Goldstein <amir73il@xxxxxxxxx> Just one question occurred to me (after discussion with a colleague about this feature): Ming, why do you actually need to know thread ID and thread-group ID is not enough? Also note that standard glibc threading functions are *not* going to be compatible with the ID returned from fanotify (e.g. it will be different from POSIX thread ID as returned by pthread_self()). So the feature is somewhat difficult to use from userspace... (at least you could use gettid() systemcall to get the ID of current thread but there's not glibc wrapper for it). Honza -- Jan Kara <jack@xxxxxxxx> SUSE Labs, CR