Created
August 17, 2021 18:49
-
-
Save robbmanes/a7a23f6db77db9f63cc54c7ac1939217 to your computer and use it in GitHub Desktop.
iopl syscall test
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <sys/io.h> | |
#include <errno.h> | |
#define LEVEL 3 | |
int main(int argc, char **argv) | |
{ | |
int rc; | |
rc = iopl(LEVEL); | |
switch(rc) { | |
case -EINVAL: | |
printf("Incorrect level (greater than 3)\n"); | |
break; | |
case -ENOSYS: | |
printf("iopl() call is not implemented.\n"); | |
break; | |
case -EPERM: | |
printf("Insufficient privileges to call iopl().\n"); | |
break; | |
default: | |
printf("Success calling iopl(): code %d\n", rc); | |
} | |
return rc; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment