Need help regarding kernel threads

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

 



Hi,

Can sombody help me with the following:

How to differentiate kernel threads from normal
processes inside the Linux kernel code? 

I want to handle all the processes headed by "init_ 
task", in such a way that kernel threads are excluded
in the special processing. But , I am not able to find
out a kernel data structure which helps me in
identifying whether the "task_struct" is a normal
process or a kernel thread.

For ex, if i use the following snippet of code,

 for(p=&init_task; (p=next_task(p)) != &init_task;)
 {
        printk("%s\n", p->comm);
 } 

it prints all the processes running including kernel
threads(init, keventd, kswapd etc etc). Now, I want to
check whether the "task_struct" is a process or a
kernel thread? 

How do I handle processes seperately from kernel
threads??

Thank you,
Vinay.


		
_______________________________________________________
Too much spam in your inbox? Yahoo! Mail gives you the best spam protection for FREE! http://in.mail.yahoo.com
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]
  Powered by Linux