From 58dd684c4e86944301959a140dbed9746df35779 Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Tue, 5 Dec 2023 00:03:04 +0100 Subject: Second commit MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- testutil/get-syscall-range.c | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 testutil/get-syscall-range.c (limited to 'testutil/get-syscall-range.c') diff --git a/testutil/get-syscall-range.c b/testutil/get-syscall-range.c new file mode 100644 index 0000000..9f26b8e --- /dev/null +++ b/testutil/get-syscall-range.c @@ -0,0 +1,41 @@ +/* See LICENSE file for copyright and license details. */ +#include "../libsyscalls.h" + +#include +#include +#include + + +int +main(int argc, char *argv[]) +{ + enum libsyscalls_os os; + enum libsyscalls_arch arch; + long long int min, max; + enum libsyscalls_error err; + + (void) argc; + + os = (enum libsyscalls_os)atoi(argv[1]); + arch = (enum libsyscalls_arch)atoi(argv[2]); + + err = libsyscalls_get_syscall_range(os, arch, &min, &max); + if (err == LIBSYSCALLS_E_OSNOSUP || err == LIBSYSCALLS_E_ARCHNOSUP) { + printf("min: x\n"); + printf("max: x\n"); + return 0; + } else if (err) { + fprintf(stderr, "test-get-syscall-range %s %s: ", argv[3], argv[4]); + libsyscalls_perror(NULL, err); + return 1; + } + + printf("min: %lli\n", min); + printf("max: %lli\n", max); + + if (fflush(stdout) || fclose(stdout)) { + perror(NULL); + return 1; + } + return 0; +} -- cgit v1.2.3-70-g09d2