Linux - KernelThis forum is for all discussion relating to the Linux kernel.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I'm currently stuck at the same problem with kernel 2.6.32 and I followed the suggested links and here is the resulting procedure in my module.
The required process id is provided via ioctl from the associated_process.
But, I can't get the thing compiled! Actually, the find_task_by_pid_ns call is the problem. Obviously, some link is missing but which?
Just check the signal that you want to send has the same signal number in user space, because some signal numbers are differently mapped in kernel space and user space.
Anyway, I don't understand how to get the task_struct for my user process which has to receive the signal?
Addressing send_sig to the current task sends the signal to the module thread itself. Or do I have to walk through the whole thread structure, looking for the right pid?
The "current" task will be the currently executing task "at that time" when you registered or called the ioctl command before you send signal to it. You save it to a variable so that it will not refer to the "current" task that will send the signal.
I didn't know that the macro "current" returns the task that is currently calling the ioctl. Thus, it is not necessary to actually provide the pid of the calling process via ioctl. It is simply the call itself.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.