From c131f122778c62f920a99bbf854ced4a37ee8b03 Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Sun, 3 Dec 2023 19:23:35 +0100 Subject: First commit MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- libsyscalls_get_syscall_range.c | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 libsyscalls_get_syscall_range.c (limited to 'libsyscalls_get_syscall_range.c') diff --git a/libsyscalls_get_syscall_range.c b/libsyscalls_get_syscall_range.c new file mode 100644 index 0000000..eb9b11e --- /dev/null +++ b/libsyscalls_get_syscall_range.c @@ -0,0 +1,26 @@ +/* See LICENSE file for copyright and license details. */ +#include "common.h" + + +#include "generated/get_syscall_range.c" + +enum libsyscalls_error +libsyscalls_get_syscall_range(enum libsyscalls_os os, enum libsyscalls_arch arch, long long int *min_out, long long int *max_out) +{ + long long int discarded; + + if (!min_out) min_out = &discarded; + if (!max_out) max_out = &discarded; + +#define CASE(UPPERCASE, LOWERCASE)\ + case LIBSYSCALLS_OS_##UPPERCASE:\ + return get_##LOWERCASE##_syscall_range(arch, min_out, max_out) + + switch ((int)os) { + LIST_OSES(CASE, ;); + default: + return LIBSYSCALLS_E_OSNOSUP; + } + +#undef CASE +} -- cgit v1.2.3-70-g09d2