Skip to content

Commit 67eb617

Browse files
t-8chwtarreau
authored andcommitted
selftests/nolibc: simplify call to ioperm
Since commit 53fcfaf ("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]>
1 parent 2d7481e commit 67eb617

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

tools/testing/selftests/nolibc/nolibc-test.c

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1051,11 +1051,7 @@ int main(int argc, char **argv, char **envp)
10511051
* exit with status code 2N+1 when N is written to 0x501. We
10521052
* hard-code the syscall here as it's arch-dependent.
10531053
*/
1054-
#if defined(_NOLIBC_SYS_H)
1055-
else if (my_syscall3(__NR_ioperm, 0x501, 1, 1) == 0)
1056-
#else
1057-
else if (ioperm(0x501, 1, 1) == 0)
1058-
#endif
1054+
else if (syscall(__NR_ioperm, 0x501, 1, 1) == 0)
10591055
__asm__ volatile ("outb %%al, %%dx" :: "d"(0x501), "a"(0));
10601056
/* if it does nothing, fall back to the regular panic */
10611057
#endif

0 commit comments

Comments
 (0)