1IOPL(2)                    Linux Programmer's Manual                   IOPL(2)
2
3
4

NAME

6       iopl - change I/O privilege level
7

SYNOPSIS

9       #include <sys/io.h>
10
11       int iopl(int level);
12

DESCRIPTION

14       iopl() changes the I/O privilege level of the calling process, as spec‐
15       ified by the two least significant bits in level.
16
17       This call is necessary to allow 8514-compatible X servers to run  under
18       Linux.   Since  these  X servers require access to all 65536 I/O ports,
19       the ioperm(2) call is not sufficient.
20
21       In addition to granting unrestricted I/O  port  access,  running  at  a
22       higher  I/O  privilege  level also allows the process to disable inter‐
23       rupts.  This will probably crash the system, and is not recommended.
24
25       Permissions are inherited by fork(2) and execve(2).
26
27       The I/O privilege level for a normal process is 0.
28
29       This call is mostly for the i386 architecture.  On many other architec‐
30       tures it does not exist or will always return an error.
31

RETURN VALUE

33       On  success,  zero is returned.  On error, -1 is returned, and errno is
34       set appropriately.
35

ERRORS

37       EINVAL level is greater than 3.
38
39       ENOSYS This call is unimplemented.
40
41       EPERM  The calling process has insufficient privilege to  call  iopl();
42              the CAP_SYS_RAWIO capability is required to raise the I/O privi‐
43              lege level above its current value.
44

CONFORMING TO

46       iopl() is Linux-specific and should not be used in  programs  that  are
47       intended to be portable.
48

NOTES

50       Libc5  treats  it  as  a system call and has a prototype in <unistd.h>.
51       Glibc1 does not have a prototype.   Glibc2  has  a  prototype  both  in
52       <sys/io.h>  and  in <sys/perm.h>.  Avoid the latter, it is available on
53       i386 only.
54

SEE ALSO

56       ioperm(2), outb(2), capabilities(7)
57

COLOPHON

59       This page is part of release 3.53 of the Linux  man-pages  project.   A
60       description  of  the project, and information about reporting bugs, can
61       be found at http://www.kernel.org/doc/man-pages/.
62
63
64
65Linux                             2013-03-15                           IOPL(2)
Impressum