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 thread, as speci‐
15 fied by the two least significant bits in level.
16
17 The I/O privilege level for a normal thread is 0. Permissions are in‐
18 herited from parents to children.
19
20 This call is deprecated, is significantly slower than ioperm(2), and is
21 only provided for older X servers which require access to all 65536 I/O
22 ports. It is mostly for the i386 architecture. On many other archi‐
23 tectures it does not exist or will always return an error.
24
26 On success, zero is returned. On error, -1 is returned, and errno is
27 set to indicate the error.
28
30 EINVAL level is greater than 3.
31
32 ENOSYS This call is unimplemented.
33
34 EPERM The calling thread has insufficient privilege to call iopl();
35 the CAP_SYS_RAWIO capability is required to raise the I/O privi‐
36 lege level above its current value.
37
39 iopl() is Linux-specific and should not be used in programs that are
40 intended to be portable.
41
43 Glibc2 has a prototype both in <sys/io.h> and in <sys/perm.h>. Avoid
44 the latter, it is available on i386 only.
45
46 Prior to Linux 5.5 iopl() allowed the thread to disable interrupts
47 while running at a higher I/O privilege level. This will probably
48 crash the system, and is not recommended.
49
50 Prior to Linux 3.7, on some architectures (such as i386), permissions
51 were inherited by the child produced by fork(2) and were preserved
52 across execve(2). This behavior was inadvertently changed in Linux
53 3.7, and won't be reinstated.
54
56 ioperm(2), outb(2), capabilities(7)
57
59 This page is part of release 5.13 of the Linux man-pages project. A
60 description of the project, information about reporting bugs, and the
61 latest version of this page, can be found at
62 https://www.kernel.org/doc/man-pages/.
63
64
65
66Linux 2021-03-22 IOPL(2)