]> git.ipfire.org Git - thirdparty/man-pages.git/blobdiff - man2/ioperm.2
execve.2, exec.3: Consistently use the term 'pathname' (not 'path')
[thirdparty/man-pages.git] / man2 / ioperm.2
index 917c1077411af0b76fd8deb3573231e2f7815f1c..86639daca4399a266f9a14a1d7b4c8f205a4189d 100644 (file)
 .\" Modified, 27 May 2004, Michael Kerrisk <mtk.manpages@gmail.com>
 .\"     Added notes on capability requirements
 .\"
-.TH IOPERM 2 2013-03-12 "Linux" "Linux Programmer's Manual"
+.TH IOPERM 2 2017-09-15 "Linux" "Linux Programmer's Manual"
 .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
+.PP
 .BI "int ioperm(unsigned long " from ", unsigned long " num ", int " turn_on );
 .SH DESCRIPTION
 .BR ioperm ()
@@ -48,7 +45,7 @@ sets the port access permission bits for the calling thread for
 .I num
 bits starting from port address
 .IR from .
-If 
+If
 .I turn_on
 is nonzero, then permission for the specified bits is enabled;
 otherwise it is disabled.
@@ -56,24 +53,24 @@ If
 .I turn_on
 is nonzero, the calling thread must be privileged
 .RB ( CAP_SYS_RAWIO ).
-
+.PP
 Before Linux 2.6.8,
 only the first 0x3ff I/O ports could be specified in this manner.
 For more ports, the
 .BR iopl (2)
-system call had to be used.
+system call had to be used (with a
+.I level
+argument of 3).
 Since Linux 2.6.8, 65,536 I/O ports can be specified.
-
-Permissions are not inherited by the child created by
-.BR fork (2);
-following a
+.PP
+Permissions are inherited by the child created by
 .BR fork (2)
-the child must turn on those permissions that it needs.
+(but see NOTES).
 Permissions are preserved across
 .BR execve (2);
 this is useful for giving port access permissions to unprivileged
 programs.
-
+.PP
 This call is mostly for the i386 architecture.
 On many other architectures it does not exist or will always
 return an error.
@@ -104,14 +101,22 @@ The calling thread has insufficient privilege.
 is Linux-specific and should not be used in programs
 intended to be portable.
 .SH NOTES
-Libc5 treats it as a system call and has a prototype in
-.IR <unistd.h> .
-Glibc1 does not have a prototype.
-Glibc2 has a prototype both in
+The
+.I /proc/ioports
+file shows the I/O ports that are currently allocated on the system.
+.PP
+Before Linux 2.4,
+permissions were not inherited by a child created by
+.BR fork (2).
+.PP
+Glibc has an
+.BR ioperm ()
+prototype both in
 .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 outb (2),
 .BR capabilities (7)