Reading process info (task_struct) in user mode(LINUX)
Posted: Mon Nov 26, 2007 3:24 pm
Hello All,
I am completely new to Kernel Programming. Hence I will explain my requirements. I will greatly appreciate if anyone of you can help me out.
OS : Linux
Problem : To read signal information (Signal Mask , pending signals etc) of a particular process. We know pid of that process. This will be done from user mode.
My Approach: To read another process' task_struct structure (which contains essential information related to particular process) from kernel and use this information.
Roadblock: I checked /linux/sched.h . I saw a function find_task_by_pid. This function takes pid as an argument and returns task_struct of that process. But merely inclusion of this file(#include) in my code gave me millions of errors.
I will be grateful if you help me out with this. Pardon me if I have missed details , but I will be glad to provide more.
I am completely new to Kernel Programming. Hence I will explain my requirements. I will greatly appreciate if anyone of you can help me out.
OS : Linux
Problem : To read signal information (Signal Mask , pending signals etc) of a particular process. We know pid of that process. This will be done from user mode.
My Approach: To read another process' task_struct structure (which contains essential information related to particular process) from kernel and use this information.
Roadblock: I checked /linux/sched.h . I saw a function find_task_by_pid. This function takes pid as an argument and returns task_struct of that process. But merely inclusion of this file(#include) in my code gave me millions of errors.
I will be grateful if you help me out with this. Pardon me if I have missed details , but I will be glad to provide more.