From mboxrd@z Thu Jan 1 00:00:00 1970 From: daniel.baluta@gmail.com (Daniel Baluta) Date: Mon, 4 Apr 2011 12:45:20 +0300 Subject: query regarding kernel daemon In-Reply-To: References: Message-ID: To: kernelnewbies@lists.kernelnewbies.org List-Id: kernelnewbies.lists.kernelnewbies.org > 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(). Don't use interruptible_sleep_on use wait_event* instead. thanks, Daniel. [1] http://lxr.linux.no/linux+v2.6.38/include/linux/wait.h#L570