Hello,

On Thu, Mar 22, 2007 at 04:39:03PM -0400, Vivek Thakkar wrote:
> I also ran out of it and there seems to be a way out (atleast according to
> the man pages on some latest kernel versions). I am quoting the following
> from manpage of fcntl:
> 
> "If  a  non-zero  value  is  given to F_SETSIG in a multi-threaded process
> running with a threading library that supports thread groups (e.g., NPTL),
> then a positive value given to F_SETOWN has a different meaning: instead
> of being a process ID identifying a  whole  process, it is a thread ID
> identifying a specific thread within a process.  Consequently, it may be
> necessary to pass F_SETOWN the result of gettid() instead of getpid() to
> get sensible results when F_SETSIG is used.  (In current Linux threading
> implementations,  a  main  thread’s  thread  ID  is  the same as its
> process ID.  This means that a single-threaded program can equally use
> gettid() or getpid() in this scenario.)"
> 
Yes, yes. This sounds familiar. I think I played with this for older versions
of pfmon and it worked assuming you get _GNU_SOURCE. I removed it now because
I changed the structure but I think that if you try it, you'll get what you
want.

Thanks for reminding me of this trick (which is non-portable).

--
-Stephane
_______________________________________________
perfmon mailing list
[email protected]
http://www.hpl.hp.com/hosted/linux/mail-archives/perfmon/

Reply via email to