Section (2) ioperm
ioperm — set port input/output permissions
#include <sys/io.h> /* for glibc */
||unsigned long from,|
|unsigned long num,|
ioperm() sets the port
access permission bits for the calling thread for
num bits starting from port
turn_on is nonzero,
then permission for the specified bits is enabled; otherwise
it is disabled. If
turn_on is nonzero, the calling
thread must be privileged (
Before Linux 2.6.8, only the first 0x3ff I/O ports could
be specified in this manner. For more ports, the iopl(2) system call had to
be used (with a
level argument of 3). Since
Linux 2.6.8, 65,536 I/O ports can be specified.
This call is mostly for the i386 architecture. On many other architectures it does not exist or will always return an error.
On success, zero is returned. On error, −1 is
errno is set
Invalid values for
(on PowerPC) This call is not supported.
Out of memory.
The calling thread has insufficient privilege.
ioperm() is Linux-specific
and should not be used in programs intended to be
/proc/ioports file shows
the I/O ports that are currently allocated on the system.
Before Linux 2.4, permissions were not inherited by a child created by fork(2).
Glibc has an
prototype both in
Avoid the latter, it is available on i386 only.
This page is part of release 4.16 of the Linux
man-pages project. A
description of the project, information about reporting bugs,
and the latest version of this page, can be found at
Copyright (c) 1993 Michael Haardt
Fri Apr 2 11:32:09 MET DST 1993
This is free documentation; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation; either version 2 of
the License, or (at your option) any later version.
The GNU General Public License_zsingle_quotesz_s references to object code
and executables are to be interpreted as the output of any
document formatting or typesetting system, including
intermediate and printed output.
This manual is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public
License along with this manual; if not, see
Modified Sat Jul 24 15:12:05 1993 by Rik Faith <faithcs.unc.edu>
Modified Tue Aug 1 16:27 1995 by Jochen Karrer
Modified Tue Oct 22 08:11:14 EDT 1996 by Eric S. Raymond <esrthyrsus.com>
Modified Mon Feb 15 17:28:41 CET 1999 by Andries E. Brouwer <aebcwi.nl>
Modified, 27 May 2004, Michael Kerrisk <mtk.manpagesgmail.com>
Added notes on capability requirements