Debian Codegraph @

upstream/debian-trixie/man2/ioctl_userfaultfd.2

raw
1 .\" Copyright 2016, IBM Corporation.
2 .\" Written by Mike Rapoport <[email protected]>
3 .\" Copyright 2016, Michael Kerrisk <[email protected]>
4 .\" Copyright 2024, Alejandro Colomar <[email protected]>
5 .\"
6 .\" SPDX-License-Identifier: Linux-man-pages-copyleft
7 .\"
8 .TH ioctl_userfaultfd 2 2024-06-14 "Linux man-pages 6.9.1"
9 .SH NAME
10 ioctl_userfaultfd \- create a file descriptor for handling page faults in user
11 space
12 .SH LIBRARY
13 Standard C library
14 .RI ( libc ", " \-lc )
15 .SH SYNOPSIS
16 .nf
17 .BR "#include <linux/userfaultfd.h>" " /* Definition of " UFFD* " constants */"
18 .B #include <sys/ioctl.h>
19 .P
20 .BI "int ioctl(int " fd ", int " op ", ...);"
21 .fi
22 .SH DESCRIPTION
23 Various
24 .BR ioctl (2)
25 operations can be performed on a userfaultfd object (created by a call to
26 .BR userfaultfd (2))
27 using calls of the form:
28 .P
29 .in +4n
30 .EX
31 ioctl(fd, op, argp);
32 .EE
33 .in
34 .P
35 In the above,
36 .I fd
37 is a file descriptor referring to a userfaultfd object,
38 .I op
39 is one of the operations listed below, and
40 .I argp
41 is a pointer to a data structure that is specific to
42 .IR op .
43 .P
44 The various
45 .BR ioctl (2)
46 operations are described below.
47 The
48 .BR UFFDIO_API ,
49 .BR UFFDIO_REGISTER ,
50 and
51 .B UFFDIO_UNREGISTER
52 operations are used to
53 .I configure
54 userfaultfd behavior.
55 These operations allow the caller to choose what features will be enabled and
56 what kinds of events will be delivered to the application.
57 The remaining operations are
58 .I range
59 operations.
60 These operations enable the calling application to resolve page-fault
61 events.
62 .\"
63 .TP
64 .BR UFFDIO_API (2const)
65 .TQ
66 .BR UFFDIO_REGISTER (2const)
67 .TQ
68 .BR UFFDIO_UNREGISTER (2const)
69 .TQ
70 .BR UFFDIO_COPY (2const)
71 .TQ
72 .BR UFFDIO_ZEROPAGE (2const)
73 .TQ
74 .BR UFFDIO_WAKE (2const)
75 .TQ
76 .BR UFFDIO_WRITEPROTECT (2const)
77 .TQ
78 .BR UFFDIO_CONTINUE (2const)
79 .TQ
80 .BR UFFDIO_POISON (2const)
81 .SH RETURN VALUE
82 On success,
83 0 is returned.
84 On error,
85 \-1 is returned, and
86 .I errno
87 is set to indicate the error.
88 .SH ERRORS
89 The following general errors can occur for all of the
90 operations described above:
91 .TP
92 .B EFAULT
93 .I argp
94 does not point to a valid memory address.
95 .TP
96 .B EINVAL
97 (For all operations except
98 .BR UFFDIO_API .)
99 The userfaultfd object has not yet been enabled (via the
100 .B UFFDIO_API
101 operation).
102 .SH STANDARDS
103 Linux.
104 .SH EXAMPLES
105 See
106 .BR userfaultfd (2).
107 .SH SEE ALSO
108 .BR ioctl (2),
109 .BR mmap (2),
110 .BR userfaultfd (2)
111 .P
112 .I linux.git/\:Documentation/\:admin\-guide/\:mm/\:userfaultfd.rst