diff options
Diffstat (limited to 'testutil/get-signals.c')
-rw-r--r-- | testutil/get-signals.c | 14 |
1 files changed, 10 insertions, 4 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); |