Find the answer to your Linux question:
Results 1 to 5 of 5
i need help to develope the code that can display the active task lists by adding proc entry which can access the active tasks...
  1. #1
    Just Joined!
    Join Date
    Sep 2008
    Posts
    3

    how to add proc entry for displaying task lists.

    i need help to develope the code that can display the active task lists by adding proc entry which can access the active tasks

  2. #2
    Linux Guru
    Join Date
    Nov 2007
    Location
    Córdoba (Spain)
    Posts
    1,513
    Quote Originally Posted by pravi.embedded View Post
    i need help to develope the code that can display the active task lists by adding proc entry which can access the active tasks
    Each process that is running on your box has an entry under proc, look for directories whose name is formed only by numbers under /proc/. For example, /proc/1/ is for init, which has always PID=1. The name of the dir is the PID of the process.

  3. #3
    Just Joined!
    Join Date
    Sep 2008
    Posts
    3
    but how can my program read that proc file to extract the information about all processes to display the process id's and their names as like ps command works... please give me some hints as soon as possible

  4. #4
    Linux Guru
    Join Date
    Nov 2007
    Location
    Córdoba (Spain)
    Posts
    1,513
    It depends on the language you use. You could check the sources for ps, top or htop and see how they do it. They are simple tools.

  5. #5
    Just Joined!
    Join Date
    Sep 2008
    Posts
    3
    Quote Originally Posted by i92guboj View Post
    Each process that is running on your box has an entry under proc, look for directories whose name is formed only by numbers under /proc/. For example, /proc/1/ is for init, which has always PID=1. The name of the dir is the PID of the process.
    now i got the idea what actually proc entry is. i am able to add new file in the proc directory by using create_proc_entry.. i am using this function in writing a kernel module. content of structure is pid and process name of all processes. now i want to write content of this structure into that file named tasklist. how can i do it.

Posting Permissions

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