From f3634346663b7d1d4c2e10367d0309fe1e4eb1e2 Mon Sep 17 00:00:00 2001 From: Michael Kerrisk Date: Sun, 26 Nov 2006 04:13:44 +0000 Subject: [PATCH] Clarify discussion of privilege requirements. Added ENOMEM to ERRORS. --- man2/ioperm.2 | 27 +++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/man2/ioperm.2 b/man2/ioperm.2 index 6103c108af..5b470567e4 100644 --- a/man2/ioperm.2 +++ b/man2/ioperm.2 @@ -44,20 +44,22 @@ ioperm \- set port input/output permissions .sp .BI "int ioperm(unsigned long " from ", unsigned long " num ", int " turn_on ); .SH DESCRIPTION -\fBIoperm\fP sets the port access permission bits for the process for +\fBioperm\fP() sets the port access permission bits for the process for \fInum\fP bytes starting from port address \fBfrom\fP to the value -\fBturn_on\fP. The use of \fBioperm\fP() requires root privileges. +\fBturn_on\fP. +If \fBturn_on\fP is non-zero, the calling process must be privileged +.RM ( CAP_SYS_RAWIO ). -Only the first 0x3ff I/O ports can be specified in this manner. For more -ports, the +Only the first 0x3ff I/O ports can be specified in this manner. +For more ports, the .BR iopl () function must be used. Permissions are not inherited on .BR fork (), but on .BR exec () -they are. This is -useful for giving port access permissions to non-privileged tasks. +they are. +This is useful for giving port access permissions to non-privileged tasks. This call is mostly for the i386 architecture. On many other architectures it does not exist or will always @@ -77,19 +79,20 @@ or .B EIO (on ppc) This call is not supported. .TP +.B ENOMEM +.\" Could not allocate I/O bitmap. +Out of memory. +.TP .B EPERM -The calling process has insufficient privilege to call -.BR ioperm (); -the -.B CAP_SYS_RAWIO -capability is required. +The calling process has insufficient privilege. .SH "CONFORMING TO" \fBioperm\fP() 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 . -Glibc1 does not have a prototype. Glibc2 has a prototype both in +Glibc1 does not have a prototype. +Glibc2 has a prototype both in .I and in .IR . -- 2.47.2