Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

ioperm(2) [redhat man page]

IOPERM(2)						     Linux Programmer's Manual							 IOPERM(2)

NAME
ioperm - set port input/output permissions SYNOPSIS
#include <unistd.h> /* for libc5 */ #include <sys/io.h> /* for glibc */ int ioperm(unsigned long from, unsigned long num, int turn_on); DESCRIPTION
Ioperm sets the port access permission bits for the process for num bytes starting from port address from to the value turn_on. The use of ioperm requires root privileges. Only the first 0x3ff I/O ports can be specified in this manner. For more ports, the iopl function must be used. Permissions are not inherited on fork, but on exec they are. This is useful for giving port access permissions to non-privileged tasks. RETURN VALUE
On success, zero is returned. On error, -1 is returned, and errno is set appropriately. CONFORMING TO
ioperm is Linux specific and should not be used in programs intended to be portable. NOTES
Libc5 treats it as a system call and has a prototype in <unistd.h>. Glibc1 does not have a prototype. Glibc2 has a prototype both in <sys/io.h> and in <sys/perm.h>. Avoid the latter, it is available on i386 only. SEE ALSO
iopl(2) Linux 1993-01-21 IOPERM(2)

Check Out this Related Man Page

IOPERM(2)						     Linux Programmer's Manual							 IOPERM(2)

NAME
ioperm - set port input/output permissions SYNOPSIS
#include <unistd.h> /* for libc5 */ #include <sys/io.h> /* for glibc */ int ioperm(unsigned long from, unsigned long num, int turn_on); DESCRIPTION
ioperm() sets the port access permission bits for the calling process for num bytes starting from port address from to the value turn_on. If turn_on is nonzero, the calling process must be privileged (CAP_SYS_RAWIO). Only the first 0x3ff I/O ports can be specified in this manner. For more ports, the iopl(2) system call must be used. Permissions are not inherited by the child created by fork(2). Permissions are preserved across execve(2); this is useful for giving port access permissions to unprivileged programs. This call 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 appropriately. ERRORS
EINVAL Invalid values for from or num. EIO (on PowerPC) This call is not supported. ENOMEM Out of memory. EPERM The calling process has insufficient privilege. CONFORMING TO
ioperm() is Linux-specific and should not be used in programs intended to be portable. NOTES
Libc5 treats it as a system call and has a prototype in <unistd.h>. Glibc1 does not have a prototype. Glibc2 has a prototype both in <sys/io.h> and in <sys/perm.h>. Avoid the latter, it is available on i386 only. SEE ALSO
iopl(2), capabilities(7) COLOPHON
This page is part of release 3.27 of the Linux man-pages project. A description of the project, and information about reporting bugs, can be found at http://www.kernel.org/doc/man-pages/. Linux 2007-06-15 IOPERM(2)
Man Page

5 More Discussions You Might Find Interesting

1. Programming

Reading from the parallelport (a/d Converter)

Hi all For my Radio-astronomy project, I`d like to read from the parallel port. Signals are coming from a 8bit analog/digital converter over the parallelport. I`d like to read the signal (endless) and print them out on the screen. I mean in a diagramm, with 2 axis. (Time,sec. and Voltage, V... (1 Reply)
Discussion started by: fab102
1 Replies

2. UNIX for Advanced & Expert Users

outb problem

Hi, Everyone I recently have a project that require me to set a bit for CMOS address such as 0x4d. I tried to use outb(0x1,0x4d) after I use ioperm to get the permission. The program run successfully, but the bit is not set. I appreciate any suggestion. Yiji (0 Replies)
Discussion started by: linyiji
0 Replies

3. Programming

inb(); not reading charaters as expected

I am sorry if this is in any way against the rules; the code isn't intended to be malicious, though it could be. If it is that bad, please delete/lock the thread instead of banning me. So, I'm creating a keylogger, and it's not working as expected. Currently the program reads directly into the... (13 Replies)
Discussion started by: Octal
13 Replies

4. Fedora

Sending a byte to the parallel port

Greetings, A sort of newbie question... I would like to control a couple of stepper motors via the parallel port using C code. I have discovered in Linux, the ioperm() function is required before the outportb() function can be used to send a byte to the parallel port. My problem is ioperm()... (1 Reply)
Discussion started by: meyerga00
1 Replies

5. Solaris

Solaris Port Monitoring

I would like to know if it is possible to read from an I/O Port in solaris. I need to monitor the parallel port of 1 PC and save all the incoming and outgoing messages. I use a SPARC Solaris running Solaris 2.5.1. I have seen a driver for x86 based systems but none for SPARC. Any help on how to... (8 Replies)
Discussion started by: devjay
8 Replies