summaryrefslogtreecommitdiffstats
path: root/testutil/get-signals.c
diff options
context:
space:
mode:
authorMattias Andrée <maandree@kth.se>2023-12-16 13:47:10 +0100
committerMattias Andrée <maandree@kth.se>2023-12-16 13:47:10 +0100
commit522948817bebc886ad236450745466975633e977 (patch)
treef53fc385c29be9b08d9c8f9c88a00ce9d1543de4 /testutil/get-signals.c
parentAll kinds of stuff (diff)
downloadlibsyscalls-522948817bebc886ad236450745466975633e977.tar.gz
libsyscalls-522948817bebc886ad236450745466975633e977.tar.bz2
libsyscalls-522948817bebc886ad236450745466975633e977.tar.xz
Tell the user whether signals and errors are signed or unsigned
Signed-off-by: Mattias Andrée <maandree@kth.se>
Diffstat (limited to '')
-rw-r--r--testutil/get-signals.c14
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);