.\"
.\" 2007-04-30: mtk, Added description of epoll_pwait()
.\"
-.TH EPOLL_WAIT 2 2009-01-17 "Linux" "Linux Programmer's Manual"
+.TH EPOLL_WAIT 2 2012-04-17 "Linux" "Linux Programmer's Manual"
.SH NAME
epoll_wait, epoll_pwait \- wait for an I/O event on an epoll file descriptor
.SH SYNOPSIS
The
.BR epoll_wait ()
system call waits for events on the
-.B epoll
+.BR epoll (7)
instance referred to by the file descriptor
.IR epfd .
The memory area pointed to by
.I maxevents
argument must be greater than zero.
-The call waits for a maximum time of
+The call blocks the calling thread for a maximum time of
.I timeout
milliseconds.
Specifying a
.I timeout
-of \-1 makes
+of \-1 causes
.BR epoll_wait ()
-wait indefinitely, while specifying a
+to block indefinitely, while specifying a
.I timeout
-equal to zero makes
+equal to zero cause
.BR epoll_wait ()
-to return immediately even if no events are available
-(return code equal to zero).
+to return immediately, even if no events are available.
The
.I struct epoll_event
.I maxevents
is less than or equal to zero.
.SH VERSIONS
-.BR epoll_pwait ()
-was added to Linux in kernel 2.6.19.
+.BR epoll_wait ()
+was added to the kernel in version 2.6.
+.\" To be precise: kernel 2.5.44.
+.\" The interface should be finalized by Linux kernel 2.5.66.
+Library support is provided in glibc starting with version 2.3.2.
-Glibc support for
.BR epoll_pwait ()
-is provided starting with version 2.6.
+was added to Linux in kernel 2.6.19.
+Library support is provided in glibc starting with version 2.6.
.SH CONFORMING TO
.BR epoll_wait ()
-is Linux-specific, and was introduced in kernel 2.5.44.
-.\" The interface should be finalized by Linux kernel 2.5.66.
+is Linux-specific.
+.SH NOTES
+While one thread is blocked in a call to
+.BR epoll_pwait (),
+it is possible for another thread to add a file descriptor to the waited-upon
+.B epoll
+instance.
+If the new file descriptor becomes ready,
+it will cause the
+.BR epoll_wait ()
+call to unblock.
.SH "SEE ALSO"
.BR epoll_create (2),
.BR epoll_ctl (2),