userfaultfd.2: Note that O_NONBLOCK flag is required for poll() etc.

And better word the associated FIXME.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
This commit is contained in:
Michael Kerrisk 2017-03-26 17:22:27 +02:00
parent 4f03f0cc36
commit 1bf00323f5
1 changed files with 16 additions and 4 deletions

View File

@ -210,15 +210,27 @@ The userfaultfd object has not yet been enabled using the
.BR ioctl (2)
operation
.PP
The userfaultfd file descriptor can be monitored with
If the
.B O_NONBLOCK
flag is enabled in the associated open file description,
the userfaultfd file descriptor can be monitored with
.BR poll (2),
.BR select (2),
and
.BR epoll (7).
When events are available, the file descriptor indicates as readable.
.\" FIXME But, it seems, the object must be created with O_NONBLOCK.
.\" What is the rationale for this requirement? Something needs
.\" to be said in this manual page.
If the
.B O_NONBLOCK
flag is not enabled, then
.BR poll (2)
(always) indicates the file as having a
.BR POLLERR
condition, and
.BR select (2)
indicates the file descriptor as both readable and writable.
.\" FIXME What is the reason for this seemingly odd behavior with respect
.\" to the O_NONBLOCK flag? (see userfaultfd_poll() in fs/userfaultfd.c).
.\" Something needs to be said about this.
.SH RETURN VALUE
On success,
.BR userfaultfd ()