Re: query regarding kernel daemon

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> 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

_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@xxxxxxxxxxxxxxxxx
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux