1iopl(2)                       System Calls Manual                      iopl(2)
2
3
4

NAME

6       iopl - change I/O privilege level
7

LIBRARY

9       Standard C library (libc, -lc)
10

SYNOPSIS

12       #include <sys/io.h>
13
14       [[deprecated]] int iopl(int level);
15

DESCRIPTION

17       iopl() changes the I/O privilege level of the calling thread, as speci‐
18       fied by the two least significant bits in level.
19
20       The I/O privilege level for a normal thread is 0.  Permissions are  in‐
21       herited from parents to children.
22
23       This call is deprecated, is significantly slower than ioperm(2), and is
24       only provided for older X servers which require access to all 65536 I/O
25       ports.   It  is mostly for the i386 architecture.  On many other archi‐
26       tectures it does not exist or will always return an error.
27

RETURN VALUE

29       On success, zero is returned.  On error, -1 is returned, and  errno  is
30       set to indicate the error.
31

ERRORS

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

VERSIONS

42       glibc2  has  a prototype both in <sys/io.h> and in <sys/perm.h>.  Avoid
43       the latter, it is available on i386 only.
44

STANDARDS

46       Linux.
47

HISTORY

49       Prior to Linux 5.5 iopl() allowed  the  thread  to  disable  interrupts
50       while  running  at  a  higher  I/O privilege level.  This will probably
51       crash the system, and is not recommended.
52
53       Prior to Linux 3.7, on some architectures (such as  i386),  permissions
54       were  inherited  by  the  child  produced by fork(2) and were preserved
55       across execve(2).  This behavior was  inadvertently  changed  in  Linux
56       3.7, and won't be reinstated.
57

SEE ALSO

59       ioperm(2), outb(2), capabilities(7)
60
61
62
63Linux man-pages 6.05              2023-03-30                           iopl(2)
Impressum