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.
Reading foreign process info (task_struct) in user mode
This is kind of basic C isn't it.
That function is in the kernel. The kernel is a separate binary file not a library. You have to use a wrapper library that will communicate with the kernel in another way(e.g. interrupts, the syscall instruction). Since that function is in kernel-space and not user-space of course you can't use it.
That function is in the kernel. The kernel is a separate binary file not a library. You have to use a wrapper library that will communicate with the kernel in another way(e.g. interrupts, the syscall instruction). Since that function is in kernel-space and not user-space of course you can't use it.
Besides checking process signal information in Linux has nothing to do with kernel programming.. a simple shell onliner solves the problem..
hint: ps <someflags> | grep <pid>
hint: ps <someflags> | grep <pid>
The real problem with goto is not with the control transfer, but with environments. Properly tail-recursive closures get both right.