2004-11-03 13:51:07 +00:00
|
|
|
.\" Hey Emacs! This file is -*- nroff -*- source.
|
|
|
|
.\"
|
|
|
|
.\" Copyright (c) 1993 Michael Haardt
|
|
|
|
.\" (michael@moria.de)
|
|
|
|
.\" Fri Apr 2 11:32:09 MET DST 1993
|
2007-04-12 22:42:49 +00:00
|
|
|
.\"
|
2004-11-03 13:51:07 +00:00
|
|
|
.\" 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'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, write to the Free
|
|
|
|
.\" Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111,
|
|
|
|
.\" USA.
|
|
|
|
.\"
|
|
|
|
.\" Modified Sat Jul 24 15:12:05 1993 by Rik Faith <faith@cs.unc.edu>
|
2007-04-12 22:42:49 +00:00
|
|
|
.\" Modified Tue Aug 1 16:27 1995 by Jochen Karrer
|
2004-11-03 13:51:07 +00:00
|
|
|
.\" <cip307@cip.physik.uni-wuerzburg.de>
|
|
|
|
.\" Modified Tue Oct 22 08:11:14 EDT 1996 by Eric S. Raymond <esr@thyrsus.com>
|
|
|
|
.\" Modified Mon Feb 15 17:28:41 CET 1999 by Andries E. Brouwer <aeb@cwi.nl>
|
2007-09-20 06:52:22 +00:00
|
|
|
.\" Modified, 27 May 2004, Michael Kerrisk <mtk.manpages@gmail.com>
|
2004-11-03 13:51:07 +00:00
|
|
|
.\" Added notes on capability requirements
|
|
|
|
.\"
|
2007-06-11 19:07:41 +00:00
|
|
|
.TH IOPERM 2 2007-06-15 "Linux" "Linux Programmer's Manual"
|
2004-11-03 13:51:07 +00:00
|
|
|
.SH NAME
|
|
|
|
ioperm \- set port input/output permissions
|
|
|
|
.SH SYNOPSIS
|
|
|
|
.B #include <unistd.h>
|
|
|
|
/* for libc5 */
|
|
|
|
.br
|
|
|
|
.B #include <sys/io.h>
|
|
|
|
/* for glibc */
|
|
|
|
.sp
|
|
|
|
.BI "int ioperm(unsigned long " from ", unsigned long " num ", int " turn_on );
|
|
|
|
.SH DESCRIPTION
|
2007-05-12 09:06:04 +00:00
|
|
|
.BR ioperm ()
|
2007-06-11 19:07:41 +00:00
|
|
|
sets the port access permission bits for the calling process for
|
|
|
|
\fInum\fP bytes starting from port address \fIfrom\fP to the value
|
|
|
|
\fIturn_on\fP.
|
intro.1, time.1, adjtimex.2, capget.2, eventfd.2, fcntl.2, getrlimit.2, getsockopt.2, gettimeofday.2, intro.2, ioctl_list.2, ioperm.2, mlock.2, pivot_root.2, poll.2, prctl.2, ptrace.2, sched_setscheduler.2, select_tut.2, semget.2, sigaltstack.2, signalfd.2, sysctl.2, timer_settime.2, timerfd_create.2, wait.2, CPU_SET.3, argz_add.3, assert_perror.3, atexit.3, backtrace.3, bcmp.3, clearenv.3, ctime.3, dl_iterate_phdr.3, dlopen.3, ecvt.3, errno.3, error.3, ether_aton.3, exit.3, fenv.3, ferror.3, finite.3, flockfile.3, fnmatch.3, fpathconf.3, fpclassify.3, ftime.3, ftok.3, ftw.3, fwide.3, getaddrinfo.3, gethostbyname.3, getlogin.3, getnameinfo.3, getnetent.3, getopt.3, getprotoent.3, getrpcent.3, getservent.3, glob.3, hsearch.3, inet.3, isalpha.3, iswalnum.3, iswalpha.3, iswblank.3, iswcntrl.3, iswctype.3, iswdigit.3, iswgraph.3, iswlower.3, iswprint.3, iswpunct.3, iswspace.3, iswupper.3, iswxdigit.3, longjmp.3, lsearch.3, malloc.3, matherr.3, mblen.3, mbsinit.3, mbtowc.3, on_exit.3, printf.3, pthread_attr_init.3, pthread_attr_setaffinity_np.3, pthread_attr_setdetachstate.3, pthread_attr_setguardsize.3, pthread_attr_setinheritsched.3, pthread_attr_setschedparam.3, pthread_attr_setschedpolicy.3, pthread_attr_setscope.3, pthread_attr_setstack.3, pthread_attr_setstackaddr.3, pthread_attr_setstacksize.3, pthread_cancel.3, pthread_cleanup_push.3, pthread_equal.3, pthread_getattr_np.3, pthread_getcpuclockid.3, pthread_setaffinity_np.3, pthread_setcancelstate.3, pthread_setconcurrency.3, pthread_setschedparam.3, pthread_setschedprio.3, ptsname.3, putenv.3, putgrent.3, raise.3, rcmd.3, regex.3, rexec.3, rpc.3, rpmatch.3, rtnetlink.3, scandir.3, sem_init.3, setaliasent.3, setbuf.3, setenv.3, setjmp.3, signbit.3, stdio_ext.3, strtod.3, strtol.3, strtoul.3, system.3, termios.3, timeradd.3, tzset.3, ualarm.3, wctomb.3, xdr.3, st.4, tty_ioctl.4, core.5, elf.5, proc.5, bootparam.7, capabilities.7, icmp.7, ip.7, ipv6.7, math_error.7, mdoc.samples.7, mq_overview.7, pthreads.7, raw.7, regex.7, socket.7, tcp.7, tzselect.8: Global fix: s/non-zero/nonzero/
The tendency in English, as prescribed in style guides like
Chicago MoS, is towards removing hyphens after prefixes
like "non-" etc.
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2010-01-16 16:40:55 +00:00
|
|
|
If \fIturn_on\fP is nonzero, the calling process must be privileged
|
2007-03-18 05:30:51 +00:00
|
|
|
.RB ( CAP_SYS_RAWIO ).
|
2004-11-03 13:51:07 +00:00
|
|
|
|
2007-06-21 22:55:04 +00:00
|
|
|
.\" FIXME is the following ("Only the first 0x3ff I/O ports can be
|
2007-06-13 21:48:16 +00:00
|
|
|
.\" specified in this manner") still true? Looking at changes in
|
2007-06-11 19:07:41 +00:00
|
|
|
.\" include/asm-i386/processor.h between 2.4 and 2.6 suggests
|
|
|
|
.\" that the limit is different in 2.6.
|
2007-04-12 22:42:49 +00:00
|
|
|
Only the first 0x3ff I/O ports can be specified in this manner.
|
2006-11-26 04:13:44 +00:00
|
|
|
For more ports, the
|
2007-05-11 23:07:02 +00:00
|
|
|
.BR iopl (2)
|
|
|
|
system call must be used.
|
2007-06-11 19:07:41 +00:00
|
|
|
|
|
|
|
Permissions are not inherited by the child created by
|
|
|
|
.BR fork (2).
|
|
|
|
Permissions are preserved across
|
|
|
|
.BR execve (2);
|
2010-01-16 17:29:41 +00:00
|
|
|
this is useful for giving port access permissions to unprivileged
|
2007-06-11 19:07:41 +00:00
|
|
|
programs.
|
2004-11-03 13:51:07 +00:00
|
|
|
|
|
|
|
This call is mostly for the i386 architecture.
|
|
|
|
On many other architectures it does not exist or will always
|
|
|
|
return an error.
|
|
|
|
.SH "RETURN VALUE"
|
2007-04-12 22:42:49 +00:00
|
|
|
On success, zero is returned.
|
|
|
|
On error, \-1 is returned, and
|
2004-11-03 13:51:07 +00:00
|
|
|
.I errno
|
|
|
|
is set appropriately.
|
|
|
|
.SH ERRORS
|
|
|
|
.TP
|
|
|
|
.B EINVAL
|
|
|
|
Invalid values for
|
|
|
|
.I from
|
|
|
|
or
|
|
|
|
.IR num .
|
|
|
|
.TP
|
|
|
|
.B EIO
|
2007-06-11 19:07:41 +00:00
|
|
|
(on PowerPC) This call is not supported.
|
2004-11-03 13:51:07 +00:00
|
|
|
.TP
|
2006-11-26 04:13:44 +00:00
|
|
|
.B ENOMEM
|
|
|
|
.\" Could not allocate I/O bitmap.
|
|
|
|
Out of memory.
|
|
|
|
.TP
|
2004-11-03 13:51:07 +00:00
|
|
|
.B EPERM
|
2006-11-26 04:13:44 +00:00
|
|
|
The calling process has insufficient privilege.
|
2004-11-03 13:51:07 +00:00
|
|
|
.SH "CONFORMING TO"
|
2007-05-12 09:06:04 +00:00
|
|
|
.BR ioperm ()
|
2007-12-25 21:28:09 +00:00
|
|
|
is Linux-specific and should not be used in programs
|
2004-11-03 13:51:07 +00:00
|
|
|
intended to be portable.
|
|
|
|
.SH NOTES
|
|
|
|
Libc5 treats it as a system call and has a prototype in
|
|
|
|
.IR <unistd.h> .
|
2007-04-12 22:42:49 +00:00
|
|
|
Glibc1 does not have a prototype.
|
2006-11-26 04:13:44 +00:00
|
|
|
Glibc2 has a prototype both in
|
2004-11-03 13:51:07 +00:00
|
|
|
.I <sys/io.h>
|
|
|
|
and in
|
|
|
|
.IR <sys/perm.h> .
|
|
|
|
Avoid the latter, it is available on i386 only.
|
|
|
|
.SH "SEE ALSO"
|
|
|
|
.BR iopl (2),
|
|
|
|
.BR capabilities (7)
|