I386_GET_IOPERM(2)

πŸ’– i386_get_ioperm β€” NAME ✨

ok so bestie, say hi to i386_get_ioperm and i386_set_ioperm β€” they're the dynamic duo that manages per-process access to the i386 I/O port space. literally their whole job. it's giving gatekeeper but for ports πŸ’…

πŸ“š LIBRARY

Standard C Library (libc, -lc) 🫢


✨ SYNOPSIS

#include <machine/sysarch.h>

int
i386_get_ioperm(unsigned int start, unsigned int *length, int *enable);

int
i386_set_ioperm(unsigned int start, unsigned int length, int enable);

🌸 DESCRIPTION

okay so picture this: i386_get_ioperm() is the nosy bestie that tells you the permission for the process' I/O port space, and it drops that answer right into the *enable argument. the port range kicks off at start, and the number of contiguous entries gets handed back to you in *length. slay, now you know.

meanwhile i386_set_ioperm() is the one who actually sets access for a range of I/O ports β€” that range being described by the start and length arguments β€” and it flips them to whatever state the enable argument says. main character energy fr fr πŸ‘‘

πŸŽ€ RETURN VALUES

the way this works is so simple it's iconic: on a successful completion you get back 0 ✨. otherwise you get -1 😭 and the global variable errno gets set to tell you what went wrong. vibe check failed, basically.

πŸ’€ ERRORS

both i386_get_ioperm() and i386_set_ioperm() will fail if:

  • [EINVAL] β€” an invalid range was specified by the start or length arguments. not me accidentally asking for a nonsense range πŸ™ˆ
  • [EPERM] β€” the caller of i386_set_ioperm was not the superuser. yeah bestie, this one needs root. no root, no port. periodt.

πŸ‘€ SEE ALSO

πŸ¦‹ AUTHORS

this man page was written by Jonathan Lemon. ty for your service king 🫢


Debian β€’ July 27, 1998 β€” that's the source, version and date bestie, mwah πŸ’…βœ¨πŸŒΈ

πŸ“¦ where this page comes from