]> git.ipfire.org Git - thirdparty/man-pages.git/blame - man2/iopl.2
Change mtk's email address
[thirdparty/man-pages.git] / man2 / iopl.2
CommitLineData
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>
c11b1abf 30.\" Modified, 27 May 2004, Michael Kerrisk <mtk.manpages@gmail.com>
fea681da
MK
31.\" Added notes on capability requirements
32.\"
d9343c5c 33.TH IOPL 2 2004-05-27 "Linux" "Linux Programmer's Manual"
fea681da
MK
34.SH NAME
35iopl \- 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
42changes the I/O privilege level of the current process, as specified in
43.IR level .
44
45This call is necessary to allow 8514-compatible X servers to run under
c13182ef
MK
46Linux.
47Since these X servers require access to all 65536 I/O ports, the
0bfa087b 48.BR ioperm (2)
fea681da
MK
49call is not sufficient.
50
51In addition to granting unrestricted I/O port access, running at a higher
c13182ef
MK
52I/O privilege level also allows the process to disable interrupts.
53This will probably crash the system, and is not recommended.
fea681da 54
4a225b7a 55Permissions are inherited by
0bfa087b 56.BR fork (2)
c13182ef 57and
0bfa087b 58.BR execve (2).
fea681da
MK
59
60The I/O privilege level for a normal process is 0.
61
62This call is mostly for the i386 architecture.
63On many other architectures it does not exist or will always
64return an error.
65.SH "RETURN VALUE"
c13182ef
MK
66On success, zero is returned.
67On error, \-1 is returned, and
fea681da
MK
68.I errno
69is set appropriately.
70.SH ERRORS
71.TP
72.B EINVAL
73.I level
74is greater than 3.
75.TP
76.B ENOSYS
77This call is unimplemented.
78.TP
79.B EPERM
c13182ef 80The calling process has insufficient privilege to call
e511ffb6 81.BR iopl ();
fea681da
MK
82the
83.B CAP_SYS_RAWIO
84capability is required.
85.SH "CONFORMING TO"
60a90ecd
MK
86.BR iopl ()
87is Linux specific and should not be used in processes
fea681da
MK
88intended to be portable.
89.SH NOTES
90Libc5 treats it as a system call and has a prototype in
91.IR <unistd.h> .
c13182ef
MK
92Glibc1 does not have a prototype.
93Glibc2 has a prototype both in
fea681da
MK
94.I <sys/io.h>
95and in
96.IR <sys/perm.h> .
97Avoid the latter, it is available on i386 only.
98.SH "SEE ALSO"
99.BR ioperm (2),
100.BR capabilities (7)