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 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.
43

CONFORMING TO

45       iopl()  is  Linux-specific and should not be used in processes intended
46       to be portable.
47

NOTES

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

SEE ALSO

55       ioperm(2), capabilities(7)
56

COLOPHON

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