]> git.ipfire.org Git - thirdparty/man-pages.git/blame - man2/iopl.2
man*/: srcfix (Use .P instead of .PP or .LP)
[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>
c6d039a3 22.P
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 .
c6d039a3 30.P
6caf6c43
TP
31The I/O privilege level for a normal thread is 0.
32Permissions are inherited from parents to children.
c6d039a3 33.P
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.
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.
66glibc2 has a prototype both in
fea681da
MK
67.I <sys/io.h>
68and in
69.IR <sys/perm.h> .
70Avoid the latter, it is available on i386 only.
4131356c
AC
71.SH STANDARDS
72Linux.
73.SH HISTORY
6caf6c43
TP
74Prior to Linux 5.5
75.BR iopl ()
76allowed the thread to disable interrupts while running
feb9ef38
MK
77at a higher I/O privilege level.
78This will probably crash the system, and is not recommended.
c6d039a3 79.P
38931a4d
MK
80Prior to Linux 3.7,
81on some architectures (such as i386), permissions
82.I were
83inherited by the child produced by
84.BR fork (2)
85and were preserved across
86.BR execve (2).
87This behavior was inadvertently changed in Linux 3.7,
88and won't be reinstated.
47297adb 89.SH SEE ALSO
fea681da 90.BR ioperm (2),
4e726b9c 91.BR outb (2),
fea681da 92.BR capabilities (7)