Thanks<br><br><div class="gmail_quote">On Mon, Jan 10, 2011 at 10:16 PM, Rajat Sharma <span dir="ltr"><<a href="mailto:fs.rajat@gmail.com">fs.rajat@gmail.com</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>
yes you are missing a very vital thing and that is EXPORT_SYMBOL.<br>
Loadable Kernel modules are not part of kernel image and can not just<br>
use any symbol of kernel, They can use only exported symbols either<br>
exported through EXPORT_SYMBOL or EXPORT_SYMBOL_GPL. GPL version has<br>
limitation that your module license should be GPL too and you have to<br>
make it open source.<br>
<br>
Anyways you can always write a similar function in your module:<br>
<br>
task_lock(tsk);<br>
strncpy(buf, tsk->comm, sizeof(tsk->comm));<br>
task_unlock(tsk);<br>
<br>
Note that task_lock is an static inline function in sched.h so you can<br>
safely use that.<br>
<br>
Rajat<br>
<div><div></div><div class="h5"><br>
On Tue, Jan 11, 2011 at 11:32 AM, Hanumant Singh <<a href="mailto:hanumant07@gmail.com">hanumant07@gmail.com</a>> wrote:<br>
> Hi<br>
> I am trying to write a simple module that sort of emulates the ps<br>
> command. I am trying to get the comm string for the task, using<br>
> get_task_comm, but the make command keeps telling me that the symbol<br>
> get_task_comm is not defined. I have included linux/sched.h. This is the<br>
> header file, which I believe has the prototype definition for the function.<br>
> Am I missing something?<br>
> Thanks<br>
> Hanumant<br>
</div></div>> _______________________________________________<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>
><br>
><br>
</blockquote></div><br>