<font face="arial black, sans-serif">I think you are looking for Upcall Functionality</font><div><font face="arial black, sans-serif"><br></font></div><div><font face="arial black, sans-serif"><span style="color:rgb(0,0,0)">upcall functionality allows a kernel module to invoke a function in user space. It is possible to start a program in user space, and give it some command line arguments, as well as setting environment variables.</span><br>
</font></div><div><span style="color:rgb(0,0,0)"><font face="arial black, sans-serif"><br></font></span></div><div><span style="color:rgb(0,0,0)"><font face="arial black, sans-serif"><br></font></span></div><div><span style="color:rgb(0,0,0)"><font face="arial black, sans-serif">**</font></span></div>
<div><font face="arial black, sans-serif"><span style="color:rgb(0,0,0)">int </span><span style="color:rgb(0,0,0)">call_usermodehelper </span><span style="color:rgb(0,0,0)"> (char * </span><i style="color:rgb(0,0,0)">path</i><span style="color:rgb(0,0,0)">, char ** </span><i style="color:rgb(0,0,0)">argv</i><span style="color:rgb(0,0,0)">, char ** </span><i style="color:rgb(0,0,0)">envp</i><span style="color:rgb(0,0,0)">, int </span><i style="color:rgb(0,0,0)">wait</i><span style="color:rgb(0,0,0)">);</span><span style="color:rgb(0,0,0)"><br>
</span></font></div><div><span style="color:rgb(0,0,0)"><font face="arial black, sans-serif"><br></font></span></div><div><p style="color:rgb(0,0,0)"><font face="arial black, sans-serif">Runs a user-space application. The application is started asynchronously if wait is not set, and runs as a child of keventd. (ie. it runs with full root capabilities).</font></p>
<p style="color:rgb(0,0,0)"></p><p style="color:rgb(0,0,0)"><font face="arial black, sans-serif">Must be called from process context. Returns a negative error code if program was not execed successfully, or 0.</font></p><p style="color:rgb(0,0,0)">
<font face="arial black, sans-serif">**man pages</font></p><p style="color:rgb(0,0,0);font-family:'Times New Roman';font-size:medium">Regards</p><p style="color:rgb(0,0,0);font-family:'Times New Roman';font-size:medium">
Santosh</p></div><div><span style="color:rgb(0,0,0);font-family:'Times New Roman';font-size:medium"><br></span></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Wed, Nov 7, 2012 at 8:30 PM, Bernd Petrovitsch <span dir="ltr"><<a href="mailto:bernd@petrovitsch.priv.at" target="_blank">bernd@petrovitsch.priv.at</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi!<br>
<br>
On Sam, 2012-11-03 at 19:14 +0530, Jeshwanth Kumar N K Jeshu wrote:<br>
[...]<br>
> Can I call userspace function from kernel module ? Actually I need to<br>
> process some data in user space for every event occured in kernel module.<br>
<br>
The usual way to implement this with a character device. The userspace<br>
application opens the character device. It then read()s the events from<br>
it, handles it and write()s results back (if needed).<br>
The kernel part handles to IRQs, puts that into a buffer where it waits<br>
for the read() from user space.<br>
<br>
You can use netlink sockets for this which may save some code though or<br>
implement a character device directly.<br>
<br>
Kind regards,<br>
Bernd<br>
<span class="HOEnZb"><font color="#888888">--<br>
Bernd Petrovitsch Email : <a href="mailto:bernd@petrovitsch.priv.at">bernd@petrovitsch.priv.at</a><br>
LUGA : <a href="http://www.luga.at" target="_blank">http://www.luga.at</a><br>
<br>
<br>
_______________________________________________<br>
Kernelnewbies mailing list<br>
<a href="mailto:Kernelnewbies@kernelnewbies.org">Kernelnewbies@kernelnewbies.org</a><br>
<a href="http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies" target="_blank">http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies</a><br>
</font></span></blockquote></div><br><br clear="all"><div><br></div>-- <br><b style="color:rgb(102,102,204)">Regards,<br>Santosh</b><br><br>
</div>