Re: [PATCH v3 7/8] fanotify: support reporting thread id instead of process id

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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



[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [Samba]     [Device Mapper]     [CEPH Development]

  Powered by Linux