Find the answer to your Linux question:
Results 1 to 2 of 2
I want to write a C program that loops through all the active processes on my system, and outputs certain information for each process, including CPU and memory usage, the ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Sep 2005
    Posts
    2

    help me


    I want to write a C program that loops through all the active processes on my system, and outputs certain information for each process, including CPU and memory usage, the process id, the user id, the session id, and others. How would I go about doing this?

    help me!
    every superman

  2. #2
    Linux Newbie
    Join Date
    Oct 2004
    Posts
    158
    The top command does this, and it is fairly involved.

    If you need it for production, consider just using top. If you're just having fun, then download the source for your system's version of top - which is very likely several different large modules.

Posting Permissions

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