All of lore.kernel.org
 help / color / mirror / Atom feed
* kernel_thread question
@ 2009-03-18 11:44 Viral Mehta
  2009-03-18 15:25 ` Stefan Richter
  0 siblings, 1 reply; 2+ messages in thread
From: Viral Mehta @ 2009-03-18 11:44 UTC (permalink / raw)
  To: linux-kernel

All,

//My thread routine
int my_thread(void*)
{
    if(printk("blah"))
        return 5; //WHERE THE HELL THIS VALUE GOES !! ?? !! HOW CAN I 
SEE ITS RETURN VALUE ??? PLEASE SUGGEST
    else
       return 0;
//WHERE THE HELL THIS RETURN VALUE GOES !! ?? !! HOW CAN I SEE ITS 
RETURN VALUE ??? PLEASE SUGGEST
//RETURNED 5 or 0 ?? I am amused
}

//my init module
int mod_init()
{
    ...
    int i;
    i = kernel_thread ((void *)my_thread, NULL, 0); //RETURNS NEW PROCESS ID
    ...
}

There is one doubt. Whatever that kernel_thread has started and it 
completes and returns some value. How can I see that value?
-- 
_____________________________________________________________________
Disclaimer: This e-mail message and all attachments transmitted with it
are intended solely for the use of the addressee and may contain legally
privileged and confidential information. If the reader of this message
is not the intended recipient, or an employee or agent responsible for
delivering this message to the intended recipient, you are hereby
notified that any dissemination, distribution, copying, or other use of
this message or its attachments is strictly prohibited. If you have
received this message in error, please notify the sender immediately by
replying to this message and please delete it from your computer. Any
views expressed in this message are those of the individual sender
unless otherwise stated.Company has taken enough precautions to prevent
the spread of viruses. However the company accepts no liability for any
damage caused by any virus transmitted by this email.
__________________________________________________________________________
 

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: kernel_thread question
  2009-03-18 11:44 kernel_thread question Viral Mehta
@ 2009-03-18 15:25 ` Stefan Richter
  0 siblings, 0 replies; 2+ messages in thread
From: Stefan Richter @ 2009-03-18 15:25 UTC (permalink / raw)
  To: Viral Mehta; +Cc: linux-kernel

Viral Mehta wrote:
> int my_thread(void*)
> {
>     if(printk("blah"))
>         return 5; //WHERE THE HELL THIS VALUE GOES !! ?? !! HOW CAN I 
> SEE ITS RETURN VALUE ???

The return value is passed over to kthread_stop().  If you don't use
kthread_stop(), the return value of threadfn does not matter.

http://lxr.linux.no/linux+v2.6.28/kernel/kthread.c#L187
-- 
Stefan Richter
-=====-==--= --== =--=-
http://arcgraph.de/sr/

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2009-03-18 15:26 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-03-18 11:44 kernel_thread question Viral Mehta
2009-03-18 15:25 ` Stefan Richter

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.