mirror of https://github.com/mkerrisk/man-pages
userfaultfd.2: wsfix
Signed-off-by: Michael Kerrisk <mtk@man7.org>
This commit is contained in:
parent
de6943fab3
commit
00f4853c43
|
@ -145,7 +145,7 @@ struct uffd_msg {
|
|||
__u8 event; /* Type of event */
|
||||
...
|
||||
union {
|
||||
struct {
|
||||
struct {
|
||||
__u64 flags; /* Flags describing fault */
|
||||
__u64 address; /* Faulting address */
|
||||
} pagefault;
|
||||
|
@ -278,7 +278,7 @@ and registers the address range of that mapping using the
|
|||
.B UFFDIO_REGISTER
|
||||
.BR ioctl (2)
|
||||
operation.
|
||||
The program then creates a second thread that will perform the
|
||||
The program then creates a second thread that will perform the
|
||||
task of handling page faults.
|
||||
|
||||
The main thread then walks through the pages of the mapping fetching
|
||||
|
@ -298,7 +298,7 @@ All such events should be
|
|||
events,
|
||||
which the thread handles by copying a page of data into
|
||||
the faulting region using the
|
||||
.B UFFDIO_COPY
|
||||
.B UFFDIO_COPY
|
||||
.BR ioctl (2)
|
||||
operation.
|
||||
|
||||
|
@ -341,7 +341,7 @@ Read address 0x7fd30106ec0f in main(): C
|
|||
\&
|
||||
.nf
|
||||
/* userfaultfd_demo.c
|
||||
|
||||
|
||||
Licensed under the GNU General Public License version 2 or later.
|
||||
*/
|
||||
#define _GNU_SOURCE
|
||||
|
@ -414,11 +414,11 @@ fault_handler_thread(void *arg)
|
|||
if (nread == 0) {
|
||||
printf("EOF on userfaultfd!\\n");
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
}
|
||||
|
||||
if (nread == \-1)
|
||||
errExit("read");
|
||||
|
||||
|
||||
/* We expect only one kind of event; verify that assumption */
|
||||
|
||||
if (msg.event != UFFD_EVENT_PAGEFAULT) {
|
||||
|
|
Loading…
Reference in New Issue