]>
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 | .\" | |
5fbde956 | 4 | .\" SPDX-License-Identifier: Linux-man-pages-copyleft |
fea681da | 5 | .\" |
c13182ef | 6 | .\" Modified Tue Aug 1 16:47 1995 by Jochen Karrer |
fea681da MK |
7 | .\" <cip307@cip.physik.uni-wuerzburg.de> |
8 | .\" Modified Tue Oct 22 08:11:14 EDT 1996 by Eric S. Raymond <esr@thyrsus.com> | |
9 | .\" Modified Fri Nov 27 14:50:36 CET 1998 by Andries Brouwer <aeb@cwi.nl> | |
c11b1abf | 10 | .\" Modified, 27 May 2004, Michael Kerrisk <mtk.manpages@gmail.com> |
fea681da MK |
11 | .\" Added notes on capability requirements |
12 | .\" | |
4c1c5274 | 13 | .TH iopl 2 (date) "Linux man-pages (unreleased)" |
fea681da MK |
14 | .SH NAME |
15 | iopl \- change I/O privilege level | |
ed278237 AC |
16 | .SH LIBRARY |
17 | Standard C library | |
8fc3b2cf | 18 | .RI ( libc ", " \-lc ) |
fea681da | 19 | .SH SYNOPSIS |
c7db92b9 | 20 | .nf |
fea681da | 21 | .B #include <sys/io.h> |
c6d039a3 | 22 | .P |
eb4a93b1 | 23 | .BI "[[deprecated]] int iopl(int " level ); |
c7db92b9 | 24 | .fi |
fea681da | 25 | .SH DESCRIPTION |
e511ffb6 | 26 | .BR iopl () |
6caf6c43 | 27 | changes the I/O privilege level of the calling thread, |
fd15ae83 | 28 | as specified by the two least significant bits in |
fea681da | 29 | .IR level . |
c6d039a3 | 30 | .P |
6caf6c43 TP |
31 | The I/O privilege level for a normal thread is 0. |
32 | Permissions are inherited from parents to children. | |
c6d039a3 | 33 | .P |
feb9ef38 MK |
34 | This call is deprecated, is significantly slower than |
35 | .BR ioperm (2), | |
6caf6c43 | 36 | and is only provided for older X servers which require |
feb9ef38 MK |
37 | access to all 65536 I/O ports. |
38 | It is mostly for the i386 architecture. | |
fea681da MK |
39 | On many other architectures it does not exist or will always |
40 | return an error. | |
47297adb | 41 | .SH RETURN VALUE |
c13182ef MK |
42 | On success, zero is returned. |
43 | On error, \-1 is returned, and | |
fea681da | 44 | .I errno |
f6a4078b | 45 | is set to indicate the error. |
fea681da MK |
46 | .SH ERRORS |
47 | .TP | |
48 | .B EINVAL | |
49 | .I level | |
50 | is greater than 3. | |
51 | .TP | |
52 | .B ENOSYS | |
53 | This call is unimplemented. | |
54 | .TP | |
55 | .B EPERM | |
6caf6c43 | 56 | The calling thread has insufficient privilege to call |
e511ffb6 | 57 | .BR iopl (); |
fea681da MK |
58 | the |
59 | .B CAP_SYS_RAWIO | |
7e6ba1f5 MK |
60 | capability is required to raise the I/O privilege level |
61 | above its current value. | |
4131356c | 62 | .SH VERSIONS |
b6c261c4 MK |
63 | .\" Libc5 treats it as a system call and has a prototype in |
64 | .\" .IR <unistd.h> . | |
75c018a1 AC |
65 | .\" glibc1 does not have a prototype. |
66 | glibc2 has a prototype both in | |
fea681da MK |
67 | .I <sys/io.h> |
68 | and in | |
69 | .IR <sys/perm.h> . | |
70 | Avoid the latter, it is available on i386 only. | |
4131356c AC |
71 | .SH STANDARDS |
72 | Linux. | |
73 | .SH HISTORY | |
6caf6c43 TP |
74 | Prior to Linux 5.5 |
75 | .BR iopl () | |
76 | allowed the thread to disable interrupts while running | |
feb9ef38 MK |
77 | at a higher I/O privilege level. |
78 | This will probably crash the system, and is not recommended. | |
c6d039a3 | 79 | .P |
38931a4d MK |
80 | Prior to Linux 3.7, |
81 | on some architectures (such as i386), permissions | |
82 | .I were | |
83 | inherited by the child produced by | |
84 | .BR fork (2) | |
85 | and were preserved across | |
86 | .BR execve (2). | |
87 | This behavior was inadvertently changed in Linux 3.7, | |
88 | and won't be reinstated. | |
47297adb | 89 | .SH SEE ALSO |
fea681da | 90 | .BR ioperm (2), |
4e726b9c | 91 | .BR outb (2), |
fea681da | 92 | .BR capabilities (7) |