OSDN Git Service

(split) Import translated manuals from JM CVS Repository.
[linuxjm/LDP_man-pages.git] / original / man2 / iopl.2
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 <mtk.manpages@gmail.com>
31 .\"     Added notes on capability requirements
32 .\"
33 .TH IOPL 2 2004-05-27 "Linux" "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
41 .BR iopl ()
42 changes the I/O privilege level of the calling process, as specified in
43 .IR level .
44
45 This call is necessary to allow 8514-compatible X servers to run under
46 Linux.
47 Since these X servers require access to all 65536 I/O ports, the
48 .BR ioperm (2)
49 call is not sufficient.
50
51 In addition to granting unrestricted I/O port access, running at a higher
52 I/O privilege level also allows the process to disable interrupts.
53 This will probably crash the system, and is not recommended.
54
55 Permissions are inherited by
56 .BR fork (2)
57 and
58 .BR execve (2).
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"
66 On success, zero is returned.
67 On error, \-1 is returned, and
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
80 The calling process has insufficient privilege to call
81 .BR iopl ();
82 the
83 .B CAP_SYS_RAWIO
84 capability is required.
85 .SH "CONFORMING TO"
86 .BR iopl ()
87 is Linux-specific and should not be used in processes
88 intended to be portable.
89 .SH NOTES
90 Libc5 treats it as a system call and has a prototype in
91 .IR <unistd.h> .
92 Glibc1 does not have a prototype.
93 Glibc2 has a prototype both in
94 .I <sys/io.h>
95 and in
96 .IR <sys/perm.h> .
97 Avoid the latter, it is available on i386 only.
98 .SH "SEE ALSO"
99 .BR ioperm (2),
100 .BR capabilities (7)