]> git.ipfire.org Git - thirdparty/man-pages.git/blame - man2/iopl.2
Import of man-pages 1.70
[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.
14.\"
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.
22.\"
23.\" Formatted or processed versions of this manual, if unaccompanied by
24.\" the source, must acknowledge the copyright and authors of this work.
25.\"
26.\" Modified Tue Aug 1 16:47 1995 by Jochen Karrer
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>
30.\" Modified, 27 May 2004, Michael Kerrisk <mtk16@ext.canterbury.ac.nz>
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
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
41.B iopl
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
46Linux. Since these X servers require access to all 65536 I/O ports, the
47.B ioperm
48call is not sufficient.
49
50In addition to granting unrestricted I/O port access, running at a higher
51I/O privilege level also allows the process to disable interrupts. This
52will probably crash the system, and is not recommended.
53
54Permissions are inherited by fork and exec.
55
56The I/O privilege level for a normal process is 0.
57
58This call is mostly for the i386 architecture.
59On many other architectures it does not exist or will always
60return an error.
61.SH "RETURN VALUE"
62On success, zero is returned. On error, \-1 is returned, and
63.I errno
64is set appropriately.
65.SH ERRORS
66.TP
67.B EINVAL
68.I level
69is greater than 3.
70.TP
71.B ENOSYS
72This call is unimplemented.
73.TP
74.B EPERM
75The calling process has insufficient privilege to call
76.BR iopl ;
77the
78.B CAP_SYS_RAWIO
79capability is required.
80.SH "CONFORMING TO"
81\fBiopl\fP is Linux specific and should not be used in processes
82intended to be portable.
83.SH NOTES
84Libc5 treats it as a system call and has a prototype in
85.IR <unistd.h> .
86Glibc1 does not have a prototype. Glibc2 has a prototype both in
87.I <sys/io.h>
88and in
89.IR <sys/perm.h> .
90Avoid the latter, it is available on i386 only.
91.SH "SEE ALSO"
92.BR ioperm (2),
93.BR capabilities (7)