Download your favorite Linux distribution at LQ ISO.
Go Back > Forums > Linux Forums > Linux - Software
User Name
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.


  Search this Thread
Old 08-01-2003, 01:37 AM   #1
LQ Newbie
Registered: Aug 2003
Posts: 1

Rep: Reputation: 0
Unhappy How to View Threads per Process

The below code gives u the thrd count given a PID on HP-UX. The same is possible through the pstat kernel interface that HP_UX provides through the pstat_getproc call. The pstat interface is not available on linux, Is there any way to get at that info.

Tried also "ps -m" option but not implemented.


#include <sys/param.h>
#include <sys/pstat.h>
#include <sys/unistd.h>
#include <stdio.h>

int pid;
struct pst_status pst;
printf("Enter pid number ... ");

if (pstat_getproc(&pst, sizeof(pst), (size_t)0, pid)!= -1)
printf("pid is %d, cmd is %s, # threads %d\n",pst.pst_pid,pst.pst_cmd,pst.pst_nlwps);



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
View threads with 0 posts newuser455 LQ Suggestions & Feedback 4 07-08-2005 06:15 PM
View all threads with 1 reply? iluvatar LQ Suggestions & Feedback 4 06-17-2004 09:18 AM
How can I view the threads where I have posted messages? Trying to Learn LQ Suggestions & Feedback 2 08-02-2003 11:29 AM
Threads And Process Penguinizer Programming 1 02-18-2003 09:39 PM
View more than 25 threads on the "view new posts" page lfslinux LQ Suggestions & Feedback 2 02-02-2002 12:07 PM > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 05:00 PM.

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