LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Kernel Module to send Message to User Space Application (https://www.linuxquestions.org/questions/linux-newbie-8/kernel-module-to-send-message-to-user-space-application-664250/)

hnshashi 08-21-2008 01:23 AM

Kernel Module to send Message to User Space Application
 
Hi all,
I want write kernel module to send message to user space application(usa).
Earlier i have written using netlink sockets, In this case first User space application sends message by filling its pid to kernel module, using
this pid kernel module can reply.

I want write module which doesn't know pid of usa,but has to send message.
(Kernel module has initiate sending message).

Is there any other concept(other than netlink socket) to achieve above.





thanks
shashidhar

jiml8 08-21-2008 10:17 PM

The kernel module has to know where to send a message to - who will receive it? If you don't provide a PID, then how are you going to know who to send the message to? You could know the name of the program and search the process list, then send the message to that process, but how else would you do it?

Further, if you search for a given program name from a kernel module, then you are defacto implementing policy in your kernel driver - and that is generally a very bad idea.

hnshashi 08-22-2008 12:48 AM

Thanks for your reply.


All times are GMT -5. The time now is 07:19 AM.