1IOPL(2) Linux Programmer's Manual IOPL(2)
2
3
4
6 iopl - change I/O privilege level
7
9 #include <sys/io.h>
10
11 int iopl(int level);
12
14 iopl() changes the I/O privilege level of the calling process, as spec‐
15 ified by the two least significant bits in level.
16
17 This call is necessary to allow 8514-compatible X servers to run under
18 Linux. Since these X servers require access to all 65536 I/O ports,
19 the ioperm(2) call is not sufficient.
20
21 In addition to granting unrestricted I/O port access, running at a
22 higher I/O privilege level also allows the process to disable inter‐
23 rupts. This will probably crash the system, and is not recommended.
24
25 Permissions are not inherited by the child process created by fork(2)
26 and are not preserved across execve(2) (but see NOTES).
27
28 The I/O privilege level for a normal process is 0.
29
30 This call is mostly for the i386 architecture. On many other architec‐
31 tures it does not exist or will always return an error.
32
34 On success, zero is returned. On error, -1 is returned, and errno is
35 set appropriately.
36
38 EINVAL level is greater than 3.
39
40 ENOSYS This call is unimplemented.
41
42 EPERM The calling process has insufficient privilege to call iopl();
43 the CAP_SYS_RAWIO capability is required to raise the I/O privi‐
44 lege level above its current value.
45
47 iopl() is Linux-specific and should not be used in programs that are
48 intended to be portable.
49
51 Glibc2 has a prototype both in <sys/io.h> and in <sys/perm.h>. Avoid
52 the latter, it is available on i386 only.
53
54 Prior to Linux 3.7, on some architectures (such as i386), permissions
55 were inherited by the child produced by fork(2) and were preserved
56 across execve(2). This behavior was inadvertently changed in Linux
57 3.7, and won't be reinstated.
58
60 ioperm(2), outb(2), capabilities(7)
61
63 This page is part of release 4.15 of the Linux man-pages project. A
64 description of the project, information about reporting bugs, and the
65 latest version of this page, can be found at
66 https://www.kernel.org/doc/man-pages/.
67
68
69
70Linux 2017-09-15 IOPL(2)