query regarding kernel daemon

shubham sharma shubham20006 at gmail.com
Mon Apr 4 05:28:51 EDT 2011


I was trying some experiments with the kernel daemon. The experiment works
as follows:



A daemon sleeps in the background. User can enter a string through the proc
interface. Whenever a string is entered, the daemon is woke. The daemon
keeps a copy of the last entered string in a variable. Initially the
variable is initialized to NULL. When the daemon wakes, it checks if the
string entered is same as the previous one or a new string is entered. When
the string is entered, in case the new or the old strings are NULL, or in
case the entered string is same as the old string the daemon goes back to
sleep (with the help of the function interruptible_sleep_on().



The problem I am facing is that when I enter the string the second time, the
system stalls. I added some sleeps in the code and figured out that when the
proc function wakes up the daemon, the system stalls.



I have attached the module code with the mail. Any suggestion for the error
would be a great help.



Shubham
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20110404/910cb349/attachment.html 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: daemon_test.c
Type: text/x-csrc
Size: 6916 bytes
Desc: not available
Url : http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20110404/910cb349/attachment.bin 


More information about the Kernelnewbies mailing list