]> git.ipfire.org Git - thirdparty/man-pages.git/blame - man2/iopl.2
Many pages: Use correct letter case in page titles (TH)
[thirdparty/man-pages.git] / man2 / iopl.2
CommitLineData
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
15iopl \- change I/O privilege level
ed278237
AC
16.SH LIBRARY
17Standard C library
8fc3b2cf 18.RI ( libc ", " \-lc )
fea681da 19.SH SYNOPSIS
c7db92b9 20.nf
fea681da 21.B #include <sys/io.h>
68e4db0a 22.PP
eb4a93b1 23.BI "[[deprecated]] int iopl(int " level );
c7db92b9 24.fi
fea681da 25.SH DESCRIPTION
e511ffb6 26.BR iopl ()
6caf6c43 27changes the I/O privilege level of the calling thread,
fd15ae83 28as specified by the two least significant bits in
fea681da 29.IR level .
efeece04 30.PP
6caf6c43
TP
31The I/O privilege level for a normal thread is 0.
32Permissions are inherited from parents to children.
efeece04 33.PP
feb9ef38
MK
34This call is deprecated, is significantly slower than
35.BR ioperm (2),
6caf6c43 36and is only provided for older X servers which require
feb9ef38
MK
37access to all 65536 I/O ports.
38It is mostly for the i386 architecture.
fea681da
MK
39On many other architectures it does not exist or will always
40return an error.
47297adb 41.SH RETURN VALUE
c13182ef
MK
42On success, zero is returned.
43On error, \-1 is returned, and
fea681da 44.I errno
f6a4078b 45is set to indicate the error.
fea681da
MK
46.SH ERRORS
47.TP
48.B EINVAL
49.I level
50is greater than 3.
51.TP
52.B ENOSYS
53This call is unimplemented.
54.TP
55.B EPERM
6caf6c43 56The calling thread has insufficient privilege to call
e511ffb6 57.BR iopl ();
fea681da
MK
58the
59.B CAP_SYS_RAWIO
7e6ba1f5
MK
60capability is required to raise the I/O privilege level
61above its current value.
3113c7f3 62.SH STANDARDS
60a90ecd 63.BR iopl ()
c8ceb0ca 64is Linux-specific and should not be used in programs that are
fea681da
MK
65intended to be portable.
66.SH NOTES
b6c261c4
MK
67.\" Libc5 treats it as a system call and has a prototype in
68.\" .IR <unistd.h> .
69.\" Glibc1 does not have a prototype.
c13182ef 70Glibc2 has a prototype both in
fea681da
MK
71.I <sys/io.h>
72and in
73.IR <sys/perm.h> .
74Avoid the latter, it is available on i386 only.
efeece04 75.PP
6caf6c43
TP
76Prior to Linux 5.5
77.BR iopl ()
78allowed the thread to disable interrupts while running
feb9ef38
MK
79at a higher I/O privilege level.
80This will probably crash the system, and is not recommended.
6caf6c43 81.PP
38931a4d
MK
82Prior to Linux 3.7,
83on some architectures (such as i386), permissions
84.I were
85inherited by the child produced by
86.BR fork (2)
87and were preserved across
88.BR execve (2).
89This behavior was inadvertently changed in Linux 3.7,
90and won't be reinstated.
47297adb 91.SH SEE ALSO
fea681da 92.BR ioperm (2),
4e726b9c 93.BR outb (2),
fea681da 94.BR capabilities (7)