]>
Commit | Line | Data |
---|---|---|
fea681da MK |
1 | .\" Copyright 1993 Rickard E. Faith (faith@cs.unc.edu) |
2 | .\" Portions extracted from linux/kernel/ioport.c (no copyright notice). | |
3 | .\" | |
93015253 | 4 | .\" %%%LICENSE_START(VERBATIM) |
fea681da MK |
5 | .\" Permission is granted to make and distribute verbatim copies of this |
6 | .\" manual provided the copyright notice and this permission notice are | |
7 | .\" preserved on all copies. | |
8 | .\" | |
9 | .\" Permission is granted to copy and distribute modified versions of this | |
10 | .\" manual under the conditions for verbatim copying, provided that the | |
11 | .\" entire resulting derived work is distributed under the terms of a | |
12 | .\" permission notice identical to this one. | |
c13182ef | 13 | .\" |
fea681da MK |
14 | .\" Since the Linux kernel and libraries are constantly changing, this |
15 | .\" manual page may be incorrect or out-of-date. The author(s) assume no | |
16 | .\" responsibility for errors or omissions, or for damages resulting from | |
17 | .\" the use of the information contained herein. The author(s) may not | |
18 | .\" have taken the same level of care in the production of this manual, | |
19 | .\" which is licensed free of charge, as they might when working | |
20 | .\" professionally. | |
c13182ef | 21 | .\" |
fea681da MK |
22 | .\" Formatted or processed versions of this manual, if unaccompanied by |
23 | .\" the source, must acknowledge the copyright and authors of this work. | |
4b72fb64 | 24 | .\" %%%LICENSE_END |
fea681da | 25 | .\" |
c13182ef | 26 | .\" Modified Tue Aug 1 16:47 1995 by Jochen Karrer |
fea681da MK |
27 | .\" <cip307@cip.physik.uni-wuerzburg.de> |
28 | .\" Modified Tue Oct 22 08:11:14 EDT 1996 by Eric S. Raymond <esr@thyrsus.com> | |
29 | .\" Modified Fri Nov 27 14:50:36 CET 1998 by Andries Brouwer <aeb@cwi.nl> | |
c11b1abf | 30 | .\" Modified, 27 May 2004, Michael Kerrisk <mtk.manpages@gmail.com> |
fea681da MK |
31 | .\" Added notes on capability requirements |
32 | .\" | |
4b8c67d9 | 33 | .TH IOPL 2 2017-09-15 "Linux" "Linux Programmer's Manual" |
fea681da MK |
34 | .SH NAME |
35 | iopl \- change I/O privilege level | |
36 | .SH SYNOPSIS | |
37 | .B #include <sys/io.h> | |
68e4db0a | 38 | .PP |
fea681da MK |
39 | .BI "int iopl(int " level ); |
40 | .SH DESCRIPTION | |
e511ffb6 | 41 | .BR iopl () |
fd15ae83 MK |
42 | changes the I/O privilege level of the calling process, |
43 | as specified by the two least significant bits in | |
fea681da | 44 | .IR level . |
efeece04 | 45 | .PP |
fea681da | 46 | This call is necessary to allow 8514-compatible X servers to run under |
c13182ef MK |
47 | Linux. |
48 | Since these X servers require access to all 65536 I/O ports, the | |
0bfa087b | 49 | .BR ioperm (2) |
fea681da | 50 | call is not sufficient. |
efeece04 | 51 | .PP |
fea681da | 52 | In addition to granting unrestricted I/O port access, running at a higher |
c13182ef MK |
53 | I/O privilege level also allows the process to disable interrupts. |
54 | This will probably crash the system, and is not recommended. | |
efeece04 | 55 | .PP |
38931a4d | 56 | Permissions are not inherited by the child process created by |
0bfa087b | 57 | .BR fork (2) |
38931a4d MK |
58 | and are not preserved across |
59 | .BR execve (2) | |
60 | (but see NOTES). | |
efeece04 | 61 | .PP |
fea681da | 62 | The I/O privilege level for a normal process is 0. |
efeece04 | 63 | .PP |
fea681da MK |
64 | This call is mostly for the i386 architecture. |
65 | On many other architectures it does not exist or will always | |
66 | return an error. | |
47297adb | 67 | .SH RETURN VALUE |
c13182ef MK |
68 | On success, zero is returned. |
69 | On error, \-1 is returned, and | |
fea681da MK |
70 | .I errno |
71 | is set appropriately. | |
72 | .SH ERRORS | |
73 | .TP | |
74 | .B EINVAL | |
75 | .I level | |
76 | is greater than 3. | |
77 | .TP | |
78 | .B ENOSYS | |
79 | This call is unimplemented. | |
80 | .TP | |
81 | .B EPERM | |
c13182ef | 82 | The calling process has insufficient privilege to call |
e511ffb6 | 83 | .BR iopl (); |
fea681da MK |
84 | the |
85 | .B CAP_SYS_RAWIO | |
7e6ba1f5 MK |
86 | capability is required to raise the I/O privilege level |
87 | above its current value. | |
47297adb | 88 | .SH CONFORMING TO |
60a90ecd | 89 | .BR iopl () |
c8ceb0ca | 90 | is Linux-specific and should not be used in programs that are |
fea681da MK |
91 | intended to be portable. |
92 | .SH NOTES | |
b6c261c4 MK |
93 | .\" Libc5 treats it as a system call and has a prototype in |
94 | .\" .IR <unistd.h> . | |
95 | .\" Glibc1 does not have a prototype. | |
c13182ef | 96 | Glibc2 has a prototype both in |
fea681da MK |
97 | .I <sys/io.h> |
98 | and in | |
99 | .IR <sys/perm.h> . | |
100 | Avoid the latter, it is available on i386 only. | |
efeece04 | 101 | .PP |
38931a4d MK |
102 | Prior to Linux 3.7, |
103 | on some architectures (such as i386), permissions | |
104 | .I were | |
105 | inherited by the child produced by | |
106 | .BR fork (2) | |
107 | and were preserved across | |
108 | .BR execve (2). | |
109 | This behavior was inadvertently changed in Linux 3.7, | |
110 | and won't be reinstated. | |
47297adb | 111 | .SH SEE ALSO |
fea681da | 112 | .BR ioperm (2), |
4e726b9c | 113 | .BR outb (2), |
fea681da | 114 | .BR capabilities (7) |