LinuxQuestions.org
Register a domain and help support LQ
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 01-29-2010, 06:37 AM   #1
Jodha
LQ Newbie
 
Registered: Jan 2010
Posts: 1

Rep: Reputation: 0
get list of thread of running process using C api (in my c code)


In short our required is that we are creating a share library which can be loaded by a process and that share library analysis the process which load it. Since share library is in address space of the process so I need to find out how many threads created by the process and what is status of their stack trace etc.

So I am looking for a way to get list of threads in running process.

Let me know if you need more information..
 
Old 01-29-2010, 08:33 AM   #2
neonsignal
Senior Member
 
Registered: Jan 2005
Location: Melbourne, Australia
Distribution: Debian Jessie (Fluxbox WM)
Posts: 1,388
Blog Entries: 52

Rep: Reputation: 355Reputation: 355Reputation: 355Reputation: 355
The process id directories in /proc provide a fair bit of information.

First call getpid, then you can search through the process directories to find those threads that are related to the same process.

The command pstree will give you something of a feel for how thread and process ids work, before you write your own implementation.

Last edited by neonsignal; 01-29-2010 at 08:35 AM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Is There any API in linux to know process ID and it's status sivareddy_jntu Linux - General 6 08-21-2009 07:19 PM
Get Process size and Thread count for a particular running process haseit Linux - Newbie 2 01-23-2009 12:09 AM
How can I get the context info for a thread/process running in user mode? LostInLinux4ever Programming 1 05-23-2007 05:00 PM
kernal API list lordofring Programming 1 08-02-2005 04:40 PM
How To List The Process Running In A Server? mphreddy Programming 1 01-23-2004 03:25 AM


All times are GMT -5. The time now is 04:34 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration