sys_epoll_wait  [fs/eventpoll.c]


Wait for I/O events on an epoll file descriptor for a specified time.

Arguments

eax 256
ebx epoll descriptor to wait events on.
ecx A pointer to an array of epoll_event structures which will be filled with events available for the caller:

struc epoll_event
{
events rd 1
data   rq 1
}

epoll_event members:

events

This member is a bit set composed using the following available event types:

EPOLLIN The associated file is available for sys_read operations.
EPOLLOUT The associated file is available for sys_write operations.
EPOLLRDHUP Stream socket peer closed connection, or shut down writing half of connection. (This flag is especially useful for writing simple code to detect peer shutdown when using Edge Triggered monitoring.)
EPOLLPRI There is urgent data available for sys_read operations.
EPOLLERR Error condition happened on the associated file descriptor. sys_epoll_wait will always wait for this event; it is not necessary to set it in epoll_event.events.
EPOLLHUP Hang up happened on the associated file descriptor. sys_epoll_wait will always wait for this event; it is not necessary to set it in epoll_event.events.
EPOLLET Sets the Edge Triggered behavior for the associated file descriptor. The default behavior for epoll is Level Triggered.
EPOLLONESHOT (since kernel 2.6.2)
Sets the one-shot behavior for the associated file descriptor. This means that after an event is pulled out with sys_epoll_wait the associated file descriptor is internally disabled and no other events will be reported by the epoll interface. The user must call sys_epoll_ctl with EPOLL_CTL_MOD to re-enable the file descriptor with a new event mask.
data
This member will contain the same data the user set with a sys_epoll_ctl (EPOLL_CTL_ADD, EPOLL_CTL_MOD)
edx Maximum number of events to wait for.
esi Maximum number of milliseconds to wait.
If -1 is specified sys_epoll_wait will wait indefinitely, while specifying a 0 will make sys_epoll_wait return immediately even if no events are available (return code equal to zero).

Return values

If the system call succeeds the return value is 0.
If the system call fails the return value is one of the following errno values:

-EBADF ebx is not a valid file descriptor.
-EFAULT The memory area pointed to by ecx is not accessible with write permissions.
-EINTR The call was interrupted by a signal handler before any of the requested events occurred or the esi expired.
-EINVAL ebx is not an epoll file descriptor, or edx is less than or equal to zero.

Remarks

n/a

Compatibility

n/a