Re: Retrieving the Processes information through modules

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I'm trying to retrieve all the processes information(name, pid ,state,
parent) with the following code:

 struct task_struct *task = current;
 for_each_process(task){

I think you are clobbering up current.

Just :

struct task_struct *task;
for_each_process(task){
...

should be enough.

Now I would like to know  whether  there is any other (better) way of
acheiving this task?!

You can get it from /proc.

--Swapnil

--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive:       http://mail.nl.linux.org/kernelnewbies/
FAQ:           http://kernelnewbies.org/faq/


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux