The UNIX and Linux Forums  


Go Back   The UNIX and Linux Forums > Top Forums > High Level Programming
.
google unix.com



High Level Programming Post questions about C, C++, Java, SQL, and other programming languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Identifying and grouping OS processes and APP processes wilsonee SUN Solaris 2 09-30-2008 10:26 AM
Monitoring Processes - Killing hung processes ukndoit UNIX for Advanced & Expert Users 4 01-17-2008 04:30 AM
How to enumerate samba shares with client siegfried IP Networking 1 08-21-2006 01:00 PM
processes mma_buc_98 UNIX for Dummies Questions & Answers 1 08-13-2002 06:25 PM
co-processes google UNIX for Dummies Questions & Answers 1 07-27-2002 10:07 PM

 
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #1 (permalink)  
Old 09-04-2008
gyula gyula is offline
Registered User
  
 

Join Date: Sep 2008
Posts: 3
Thumbs down enumerate processes

Again for windows I can enumerate processes using toolhelp library


Code:
PROCESSENTRY32  pe32 = {0};
    HANDLE           hsp = CreateToolhelp32Snapshot( TH32CS_SNAPPROCESS, 0 );

    pe32.dwSize = sizeof( PROCESSENTRY32 );
    Process32First( hsp, &pe32 );
    do
    {
         // access   PROCESSENTRY32 values
        /*
        DWORD   dwSize;
        DWORD   cntUsage;
        DWORD   th32ProcessID;          // this process
        ULONG_PTR th32DefaultHeapID;
        DWORD   th32ModuleID;           // associated exe
        DWORD   cntThreads;
        DWORD   th32ParentProcessID;    // this process's parent process
        LONG    pcPriClassBase;         // Base priority of process's threads
        DWORD   dwFlags;
        CHAR    szExeFile[MAX_PATH];    // Path
        */

    } while( Process32Next( hsp, &pe32 ) );

Is there any way to do it in linux/unix,. Ineed process ID, parent process Id and process name. I tryes to scan /proc/ folder but I cannot figure out the subfolders and files.

Thank you
The red icon (on the top-left) is a hand or a question mark ? I thought is a Q mark
 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 08:17 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0