aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Weißschuh <[email protected]>2023-07-03 10:11:08 +0200
committerWilly Tarreau <[email protected]>2023-08-23 04:38:02 +0200
commit67eb617a8e1e46ee726d0b2689dd459aab4e5e18 (patch)
treef68e0c23b9a432c377c1154f9f63a57cc2918c26
parent2d7481eb5d885ffdc1b9d948151e983341e45c38 (diff)
selftests/nolibc: simplify call to ioperm
Since commit 53fcfafa8c5c ("tools/nolibc/unistd: add syscall()") nolibc has support for syscall(2). Use it to get rid of some ifdef-ery. Signed-off-by: Thomas Weißschuh <[email protected]> Signed-off-by: Willy Tarreau <[email protected]>
-rw-r--r--tools/testing/selftests/nolibc/nolibc-test.c6
1 files changed, 1 insertions, 5 deletions
diff --git a/tools/testing/selftests/nolibc/nolibc-test.c b/tools/testing/selftests/nolibc/nolibc-test.c
index 486334981e60..c02d89953679 100644
--- a/tools/testing/selftests/nolibc/nolibc-test.c
+++ b/tools/testing/selftests/nolibc/nolibc-test.c
@@ -1051,11 +1051,7 @@ int main(int argc, char **argv, char **envp)
* exit with status code 2N+1 when N is written to 0x501. We
* hard-code the syscall here as it's arch-dependent.
*/
-#if defined(_NOLIBC_SYS_H)
- else if (my_syscall3(__NR_ioperm, 0x501, 1, 1) == 0)
-#else
- else if (ioperm(0x501, 1, 1) == 0)
-#endif
+ else if (syscall(__NR_ioperm, 0x501, 1, 1) == 0)
__asm__ volatile ("outb %%al, %%dx" :: "d"(0x501), "a"(0));
/* if it does nothing, fall back to the regular panic */
#endif