iopl2
Change i/o privilege level
Usage
#include <sys/io.h>
[[deprecated]] int iopl(int level);
Library
Standard C library (libc, -lc)
Overview
iopl() changes the I/O privilege level of the calling thread, as specified by the two least significant bits in level.
The I/O privilege level for a normal thread is 0. Permissions are inherited from parents to children.
This call is deprecated, is significantly slower than ioperm(2), and is only provided for older X servers which require access to all 65536 I/O ports. It is mostly for the i386 architecture. On many other architectures it does not exist or will always return an error.
Return value
On success, zero is returned. On error, -1 is returned, and errno is set to indicate the error.
Errors
- EINVAL
-
level is greater than 3.
- ENOSYS
-
This call is unimplemented.
- EPERM
-
The calling thread has insufficient privilege to call
iopl(); theCAP_SYS_RAWIOcapability is required to raise the I/O privilege level above its current value.
Versions
glibc2 has a prototype both in <sys/io.h> and in <sys/perm.h>. Avoid the latter, it is available on i386 only.
Releases
19 releases since Debian 1.1 (Buzz); the text changed 17 times.