summaryrefslogtreecommitdiffstats
path: root/testutil/get-signals.c
diff options
context:
space:
mode:
authorMattias Andrée <maandree@kth.se>2023-12-05 20:10:48 +0100
committerMattias Andrée <maandree@kth.se>2023-12-05 20:10:48 +0100
commit6d77b155bcd4725e09837604e6ea86f5f124ba9c (patch)
tree7cfdf466bb94bbbe3e7929432bc048da5eaa2349 /testutil/get-signals.c
parentSecond commit (diff)
downloadlibsyscalls-6d77b155bcd4725e09837604e6ea86f5f124ba9c.tar.gz
libsyscalls-6d77b155bcd4725e09837604e6ea86f5f124ba9c.tar.bz2
libsyscalls-6d77b155bcd4725e09837604e6ea86f5f124ba9c.tar.xz
Third commit
Signed-off-by: Mattias Andrée <maandree@kth.se>
Diffstat (limited to 'testutil/get-signals.c')
-rw-r--r--testutil/get-signals.c20
1 files changed, 13 insertions, 7 deletions
diff --git a/testutil/get-signals.c b/testutil/get-signals.c
index 846a0c1..f97484f 100644
--- a/testutil/get-signals.c
+++ b/testutil/get-signals.c
@@ -5,22 +5,28 @@
#include <stdio.h>
#include <stdlib.h>
+#if defined(__clang__)
+# pragma clang diagnostic ignored "-Wunsafe-buffer-usage" /* clang is just being silly */
+#endif
+
int
-main(int argc, char *argv[])
+main(int argc, char **argv)
{
- enum libsyscalls_os os;
- enum libsyscalls_arch arch;
+ int os, arch;
const struct libsyscalls_named_number *signals;
size_t i, nsignals;
enum libsyscalls_error err;
- (void) argc;
+ if (argc != 5) {
+ fprintf(stderr, "usage error\n");
+ return 3;
+ }
- os = (enum libsyscalls_os)atoi(argv[1]);
- arch = (enum libsyscalls_arch)atoi(argv[2]);
+ os = atoi(argv[1]);
+ arch = atoi(argv[2]);
- libsyscalls_get_signals(os, arch, &signals, &nsignals);
+ err = libsyscalls_get_signals((enum libsyscalls_os)os, (enum libsyscalls_arch)arch, &signals, &nsignals);
if (err == LIBSYSCALLS_E_OSNOSUP || err == LIBSYSCALLS_E_ARCHNOSUP) {
printf("x\n");
return 0;