Help answer threads with 0 replies.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
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!


  Search this Thread
Old 01-29-2010, 05:37 AM   #1
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, 07:33 AM   #2
Senior Member
Registered: Jan 2005
Location: Melbourne, Australia
Distribution: Debian Bookworm (Fluxbox WM)
Posts: 1,391
Blog Entries: 53

Rep: Reputation: 360Reputation: 360Reputation: 360Reputation: 360
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 07:35 AM.


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 06:19 PM
Get Process size and Thread count for a particular running process haseit Linux - Newbie 2 01-22-2009 11:09 PM
How can I get the context info for a thread/process running in user mode? LostInLinux4ever Programming 1 05-23-2007 04:00 PM
kernal API list lordofring Programming 1 08-02-2005 03:40 PM
How To List The Process Running In A Server? mphreddy Programming 1 01-23-2004 02:25 AM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 10:41 AM.

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