diff options
Diffstat (limited to '')
-rw-r--r-- | testutil/get-syscall-errors.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/testutil/get-syscall-errors.c b/testutil/get-syscall-errors.c index d1ddfd7..a5923f4 100644 --- a/testutil/get-syscall-errors.c +++ b/testutil/get-syscall-errors.c @@ -13,7 +13,7 @@ int main(int argc, char **argv) { - int os, arch; + int os, arch, are_signed; const struct libsyscalls_named_number *errors; size_t i, nerrors; enum libsyscalls_error err; @@ -26,7 +26,8 @@ main(int argc, char **argv) os = atoi(argv[1]); arch = atoi(argv[2]); - err = libsyscalls_get_syscall_errors((enum libsyscalls_os)os, (enum libsyscalls_arch)arch, &errors, &nerrors); + err = libsyscalls_get_syscall_errors((enum libsyscalls_os)os, (enum libsyscalls_arch)arch, + &errors, &nerrors, &are_signed); if (err == LIBSYSCALLS_E_OSNOSUP || err == LIBSYSCALLS_E_ARCHNOSUP) { printf("x\n"); return 0; @@ -38,8 +39,13 @@ main(int argc, char **argv) return 1; } - for (i = 0; i < nerrors; i++) - printf("%lli %llu %s\n", errors[i].number.s, errors[i].number.u, errors[i].name); + if (are_signed) { + for (i = 0; i < nerrors; i++) + printf("%+lli %s\n", errors[i].number.s, errors[i].name); + } else { + for (i = 0; i < nerrors; i++) + printf("%llu %s\n", errors[i].number.u, errors[i].name); + } if (fflush(stdout) || fclose(stdout)) { perror(NULL); |