MirBSD manpage: i386_get_ioperm(2), i386_set_ioperm(2)

I386_GET_IOPERM(2)      BSD Programmer's Manual (i386)      I386_GET_IOPERM(2)


     i386_get_ioperm, i386_set_ioperm - manage i386 per-process I/O permission


     #include <sys/types.h>
     #include <machine/sysarch.h>

     i386_get_ioperm(u_long *iomap);

     i386_set_ioperm(u_long *iomap);


     i386_get_ioperm() copies the current I/O permission bitmap into the
     memory referenced by iomap.

     i386_set_ioperm() sets the I/O permission bitmap from the data pointed to
     by iomap. This call is restricted to the superuser.

     The permission bitmap contains 1024 bits in 32 longwords. If bit n is
     clear in the bitmap, then access is granted to I/O port n. If bit n is
     set in the bitmap, then an attempt to access I/O port n results in
     delivery of a SIGBUS signal unless the process's I/O permission level
     would grant I/O access.

     Note: Code using the i386_get_ioperm() and i386_set_ioperm() functions
     must be compiled using -li386.


     Upon successful completion, i386_get_ioperm() and i386_set_ioperm() re-
     turn 0. Otherwise, a value of -1 is returned and the global variable
     errno is set to indicate the error.


     i386_get_ioperm() and i386_set_ioperm() will fail if:

     [EFAULT]  iomap points outside the process's allocated address space.

     [EPERM]   The caller was not the superuser.



     Intel, i386 Microprocessor Programmer's Reference Manual.


     You can really hose your machine if you enable user-level I/O and write
     to hardware ports without care.


     The bitmap should really cover 65536 bits, but that's just too big for
     allocation in a kernel structure. If you need access to ports beyond
     1024, use i386_iopl(2).

MirBSD #10-current             October 14, 1995                              1

Generated on 2022-12-24 01:00:14 by $MirOS: src/scripts/roff2htm,v 1.113 2022/12/21 23:14:31 tg Exp $ — This product includes material provided by mirabilos.

These manual pages and other documentation are copyrighted by their respective writers; their sources are available at the project’s CVSweb, AnonCVS and other mirrors. The rest is Copyright © 2002–2022 MirBSD.

This manual page’s HTML representation is supposed to be valid XHTML/1.1; if not, please send a bug report — diffs preferred.

Kontakt / Impressum & Datenschutzerklärung