diff options
Diffstat (limited to 'testutil')
-rw-r--r-- | testutil/get-signals.c | 14 | ||||
-rw-r--r-- | testutil/get-syscall-errors.c | 14 |
2 files changed, 20 insertions, 8 deletions
diff --git a/testutil/get-signals.c b/testutil/get-signals.c index f97484f..54fcac4 100644 --- a/testutil/get-signals.c +++ b/testutil/get-signals.c @@ -13,7 +13,7 @@ int main(int argc, char **argv) { - int os, arch; + int os, arch, are_signed; const struct libsyscalls_named_number *signals; size_t i, nsignals; enum libsyscalls_error err; @@ -26,7 +26,8 @@ main(int argc, char **argv) os = atoi(argv[1]); arch = atoi(argv[2]); - err = libsyscalls_get_signals((enum libsyscalls_os)os, (enum libsyscalls_arch)arch, &signals, &nsignals); + err = libsyscalls_get_signals((enum libsyscalls_os)os, (enum libsyscalls_arch)arch, + &signals, &nsignals, &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 < nsignals; i++) - printf("%lli %llu %s\n", signals[i].number.s, signals[i].number.u, signals[i].name); + if (are_signed) { + for (i = 0; i < nsignals; i++) + printf("%+lli %s\n", signals[i].number.s, signals[i].name); + } else { + for (i = 0; i < nsignals; i++) + printf("%llu %s\n", signals[i].number.u, signals[i].name); + } if (fflush(stdout) || fclose(stdout)) { perror(NULL); 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); |