]>
Commit | Line | Data |
---|---|---|
fea681da MK |
1 | .\" Hey Emacs! This file is -*- nroff -*- source. |
2 | .\" | |
3 | .\" Copyright 1993 Rickard E. Faith (faith@cs.unc.edu) | |
4 | .\" Portions extracted from linux/kernel/ioport.c (no copyright notice). | |
5 | .\" | |
6 | .\" Permission is granted to make and distribute verbatim copies of this | |
7 | .\" manual provided the copyright notice and this permission notice are | |
8 | .\" preserved on all copies. | |
9 | .\" | |
10 | .\" Permission is granted to copy and distribute modified versions of this | |
11 | .\" manual under the conditions for verbatim copying, provided that the | |
12 | .\" entire resulting derived work is distributed under the terms of a | |
13 | .\" permission notice identical to this one. | |
c13182ef | 14 | .\" |
fea681da MK |
15 | .\" Since the Linux kernel and libraries are constantly changing, this |
16 | .\" manual page may be incorrect or out-of-date. The author(s) assume no | |
17 | .\" responsibility for errors or omissions, or for damages resulting from | |
18 | .\" the use of the information contained herein. The author(s) may not | |
19 | .\" have taken the same level of care in the production of this manual, | |
20 | .\" which is licensed free of charge, as they might when working | |
21 | .\" professionally. | |
c13182ef | 22 | .\" |
fea681da MK |
23 | .\" Formatted or processed versions of this manual, if unaccompanied by |
24 | .\" the source, must acknowledge the copyright and authors of this work. | |
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> | |
305a0578 | 30 | .\" Modified, 27 May 2004, Michael Kerrisk <mtk-manpages@gmx.net> |
fea681da MK |
31 | .\" Added notes on capability requirements |
32 | .\" | |
33 | .TH IOPL 2 2004-05-27 "Linux 2.6.6" "Linux Programmer's Manual" | |
34 | .SH NAME | |
35 | iopl \- change I/O privilege level | |
36 | .SH SYNOPSIS | |
37 | .B #include <sys/io.h> | |
38 | .sp | |
39 | .BI "int iopl(int " level ); | |
40 | .SH DESCRIPTION | |
e511ffb6 | 41 | .BR iopl () |
fea681da MK |
42 | changes the I/O privilege level of the current process, as specified in |
43 | .IR level . | |
44 | ||
45 | This call is necessary to allow 8514-compatible X servers to run under | |
c13182ef MK |
46 | Linux. |
47 | Since these X servers require access to all 65536 I/O ports, the | |
e1d6264d | 48 | .BR ioperm () |
fea681da MK |
49 | call is not sufficient. |
50 | ||
51 | In addition to granting unrestricted I/O port access, running at a higher | |
c13182ef MK |
52 | I/O privilege level also allows the process to disable interrupts. |
53 | This will probably crash the system, and is not recommended. | |
fea681da | 54 | |
4a225b7a | 55 | Permissions are inherited by |
c13182ef MK |
56 | .BR fork () |
57 | and | |
58 | .BR exec (). | |
fea681da MK |
59 | |
60 | The I/O privilege level for a normal process is 0. | |
61 | ||
62 | This call is mostly for the i386 architecture. | |
63 | On many other architectures it does not exist or will always | |
64 | return an error. | |
65 | .SH "RETURN VALUE" | |
c13182ef MK |
66 | On success, zero is returned. |
67 | On error, \-1 is returned, and | |
fea681da MK |
68 | .I errno |
69 | is set appropriately. | |
70 | .SH ERRORS | |
71 | .TP | |
72 | .B EINVAL | |
73 | .I level | |
74 | is greater than 3. | |
75 | .TP | |
76 | .B ENOSYS | |
77 | This call is unimplemented. | |
78 | .TP | |
79 | .B EPERM | |
c13182ef | 80 | The calling process has insufficient privilege to call |
e511ffb6 | 81 | .BR iopl (); |
fea681da MK |
82 | the |
83 | .B CAP_SYS_RAWIO | |
84 | capability is required. | |
85 | .SH "CONFORMING TO" | |
e511ffb6 | 86 | \fBiopl\fP() is Linux specific and should not be used in processes |
fea681da MK |
87 | intended to be portable. |
88 | .SH NOTES | |
89 | Libc5 treats it as a system call and has a prototype in | |
90 | .IR <unistd.h> . | |
c13182ef MK |
91 | Glibc1 does not have a prototype. |
92 | Glibc2 has a prototype both in | |
fea681da MK |
93 | .I <sys/io.h> |
94 | and in | |
95 | .IR <sys/perm.h> . | |
96 | Avoid the latter, it is available on i386 only. | |
97 | .SH "SEE ALSO" | |
98 | .BR ioperm (2), | |
99 | .BR capabilities (7) |