1IOPERM(2)                  Linux Programmer's Manual                 IOPERM(2)
2
3
4

NAME

6       ioperm - set port input/output permissions
7

SYNOPSIS

9       #include <unistd.h> /* for libc5 */
10       #include <sys/io.h> /* for glibc */
11
12       int ioperm(unsigned long from, unsigned long num, int turn_on);
13

DESCRIPTION

15       ioperm()  sets  the port access permission bits for the process for num
16       bytes starting from port address from to the value turn_on.  If turn_on
17       is non-zero, the calling process must be privileged (CAP_SYS_RAWIO).
18
19       Only  the  first  0x3ff I/O ports can be specified in this manner.  For
20       more ports, the iopl() function must  be  used.   Permissions  are  not
21       inherited on fork(), but on exec() they are.  This is useful for giving
22       port access permissions to non-privileged tasks.
23
24       This call is mostly for the i386 architecture.  On many other architecā€
25       tures it does not exist or will always return an error.
26

RETURN VALUE

28       On  success,  zero is returned.  On error, -1 is returned, and errno is
29       set appropriately.
30

ERRORS

32       EINVAL Invalid values for from or num.
33
34       EIO    (on ppc) This call is not supported.
35
36       ENOMEM Out of memory.
37
38       EPERM  The calling process has insufficient privilege.
39

CONFORMING TO

41       ioperm() is Linux specific and should not be used in programs  intended
42       to be portable.
43

NOTES

45       Libc5  treats  it  as  a system call and has a prototype in <unistd.h>.
46       Glibc1 does not have a prototype.   Glibc2  has  a  prototype  both  in
47       <sys/io.h>  and  in <sys/perm.h>.  Avoid the latter, it is available on
48       i386 only.
49

SEE ALSO

51       iopl(2), capabilities(7)
52
53
54
55Linux 2.6.6                       2004-05-27                         IOPERM(2)
Impressum