Fei Jie | 1eb0051 | 2016-04-19 15:38:33 +0800 | [diff] [blame] | 1 | #include "tests.h" |
| 2 | #include <sys/syscall.h> |
| 3 | |
| 4 | #ifdef __NR_iopl |
| 5 | |
| 6 | # include <errno.h> |
| 7 | # include <stdio.h> |
| 8 | # include <unistd.h> |
| 9 | |
| 10 | int |
| 11 | main(void) |
| 12 | { |
| 13 | long rc = syscall(__NR_iopl, 4); |
| 14 | const char *error_text; |
| 15 | switch (errno) { |
| 16 | case ENOSYS: |
| 17 | error_text = "ENOSYS"; |
| 18 | break; |
| 19 | case EPERM: |
| 20 | error_text = "EPERM"; |
| 21 | break; |
| 22 | default: |
| 23 | error_text = "EINVAL"; |
| 24 | } |
| 25 | printf("iopl(4) = %ld %s (%m)\n", rc, error_text); |
| 26 | |
| 27 | puts("+++ exited with 0 +++"); |
| 28 | return 0; |
| 29 | } |
| 30 | |
| 31 | #else |
| 32 | |
| 33 | SKIP_MAIN_UNDEFINED("__NR_iopl") |
| 34 | |
| 35 | #endif |