From 522948817bebc886ad236450745466975633e977 Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Sat, 16 Dec 2023 13:47:10 +0100 Subject: Tell the user whether signals and errors are signed or unsigned MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- linux/errors.c | 4 +++- linux/signals.c | 4 +++- linux/symbols.c | 3 +-- 3 files changed, 7 insertions(+), 4 deletions(-) (limited to 'linux') diff --git a/linux/errors.c b/linux/errors.c index 0b1c2ea..105d343 100644 --- a/linux/errors.c +++ b/linux/errors.c @@ -6,7 +6,8 @@ #include "../generated/linux-errors.h" static enum libsyscalls_error -get_linux_syscall_errors(enum libsyscalls_arch arch, const struct libsyscalls_named_number **errs_out, size_t *nerrs_out) +get_linux_syscall_errors(enum libsyscalls_arch arch, const struct libsyscalls_named_number **errs_out, + size_t *nerrs_out, int *are_signed_out) { #define CASE(ARCH)\ *errs_out = linux_errors_for_##ARCH;\ @@ -139,6 +140,7 @@ get_linux_syscall_errors(enum libsyscalls_arch arch, const struct libsyscalls_na *nerrs_out = ELEMSOF(linux_errors_for_generic); out: + *are_signed_out = 0; return LIBSYSCALLS_E_OK; #undef CASE diff --git a/linux/signals.c b/linux/signals.c index 7adc44c..9b9dbe7 100644 --- a/linux/signals.c +++ b/linux/signals.c @@ -6,7 +6,8 @@ #include "../generated/linux-signals.h" static enum libsyscalls_error -get_linux_signals(enum libsyscalls_arch arch, const struct libsyscalls_named_number **sigs_out, size_t *nsigs_out) +get_linux_signals(enum libsyscalls_arch arch, const struct libsyscalls_named_number **sigs_out, + size_t *nsigs_out, int *are_signed_out) { #define CASE(ARCH)\ *sigs_out = linux_signals_for_##ARCH;\ @@ -139,6 +140,7 @@ get_linux_signals(enum libsyscalls_arch arch, const struct libsyscalls_named_num *nsigs_out = ELEMSOF(linux_signals_for_generic); out: + *are_signed_out = 0; return LIBSYSCALLS_E_OK; #undef CASE diff --git a/linux/symbols.c b/linux/symbols.c index ac90b80..cbfb661 100644 --- a/linux/symbols.c +++ b/linux/symbols.c @@ -27,8 +27,7 @@ static const char * extract_linux_symbol_signal(struct libsyscalls_symbol_printer_data *data, unsigned long long int *valuep, char *fallback_out) { - return extract_signal(LIBSYSCALLS_OS_LINUX, data->arch, valuep, fallback_out, - 0 /* doesn't matter, unsigned is probably faster */); + return extract_signal(LIBSYSCALLS_OS_LINUX, data->arch, valuep, fallback_out); } -- cgit v1.2.3-70-g09d2