Find the answer to your Linux question:
Results 1 to 3 of 3
i just wanted to know, how find out number of currently running process in a terminal using c code, number of process are running and sleeping...
  1. #1
    Just Joined!
    Join Date
    Nov 2007
    Posts
    27

    how to find out number of currently running process in a terminal

    i just wanted to know, how find out number of currently running process in a terminal using
    c code, number of process are running and sleeping

  2. #2
    Linux Guru Lakshmipathi's Avatar
    Join Date
    Sep 2006
    Location
    3rd rock from sun - Often seen near moon
    Posts
    1,568

    Exclamation

    I'm not sure whether we have built-in functions for this.

    For below procedure you will need to write a C program to open files and exact the string....
    But /proc will have process id as well as process name.

    /proc/pid/stat

    See the process name with '(' and ')'

    check
    [code]
    man proc
    [\code]
    - Lakshmipathi.G
    -------------------
    FOSS India Award winning ext3fs Undelete tool and tutorials www.giis.co.in
    First they criticize you,Then they laugh at you,Then they fight with you,Then you win. - M.K.Gandhi
    -------------------

  3. #3
    Just Joined!
    Join Date
    Aug 2008
    Posts
    7
    there are files with the extension .pid created in the /var/run/ folder. this may give you a clue for the running process & process id. you can write program to read those files.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
...