Fei Jie | 2e069fc | 2016-04-19 15:38:32 +0800 | [diff] [blame] | 1 | #include "tests.h" |
| 2 | #include <sys/syscall.h> |
| 3 | |
| 4 | #ifdef __NR_ioperm |
| 5 | |
Fei Jie | 2e069fc | 2016-04-19 15:38:32 +0800 | [diff] [blame] | 6 | # include <stdio.h> |
| 7 | # include <unistd.h> |
| 8 | |
| 9 | int |
| 10 | main(void) |
| 11 | { |
| 12 | const unsigned long port = (unsigned long) 0xdeafbeefffffffff; |
Dmitry V. Levin | c1dbe05 | 2016-04-21 20:59:26 +0000 | [diff] [blame] | 13 | |
Fei Jie | 2e069fc | 2016-04-19 15:38:32 +0800 | [diff] [blame] | 14 | long rc = syscall(__NR_ioperm, port, 1, 0); |
Fei Jie | 2e069fc | 2016-04-19 15:38:32 +0800 | [diff] [blame] | 15 | printf("ioperm(%#lx, %#lx, %d) = %ld %s (%m)\n", |
Dmitry V. Levin | c1dbe05 | 2016-04-21 20:59:26 +0000 | [diff] [blame] | 16 | port, 1UL, 0, rc, errno2name()); |
Fei Jie | 2e069fc | 2016-04-19 15:38:32 +0800 | [diff] [blame] | 17 | |
| 18 | puts("+++ exited with 0 +++"); |
| 19 | return 0; |
| 20 | } |
| 21 | |
| 22 | #else |
| 23 | |
| 24 | SKIP_MAIN_UNDEFINED("__NR_ioperm") |
| 25 | |
| 26 | #endif |