Re: wait_event_interruptible returns error

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

 



Hi!

On 19:46 Mon 13 Jul     , Arun raj wrote:
> Dear All,
> 
> In my driver we are waiting for some event with wait_event_interruptible.
> Some times wait_event_interruptible returns  512.
> 
> Please let me know what could be the cause and how to solve  this.

Use the _interruptible only if you are inside a system call which may return
EINTR. You can see whether this is the case by looking in the the man pages.
If it can return EINTR, then you have to return either -EINTR or -ERESTARTSYS.
Which value you have to return depends on the kind of system call it is.

Background: Signals cannot be delivered to the user space process while it is
running in kernel mode. The _interruptible functions do exactly this: If the
process is waiting in kernel mode and a signal arrives, the _interruptible
function returns with a non-zero result code and control should go back to
user space. The user space program will restart the system call after
finishing the signal handler.

	-Michi
-- 
programing a layer 3+4 network protocol for mesh networks
see http://michaelblizek.twilightparadox.com


--
To unsubscribe from this list: send an email with
"unsubscribe kernelnewbies" to ecartis@xxxxxxxxxxxx
Please read the FAQ at http://kernelnewbies.org/FAQ


[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