From 4fe86abfd168a14da63a99eccb3bb6ebe0e0271e Mon Sep 17 00:00:00 2001 From: LLONSIT Date: Wed, 22 Jan 2025 20:55:54 -0500 Subject: [PATCH] Implement sysconf(_SC_ARG_MAX) syscall --- dtc | 2 +- linux-user/irix/syscall_nr.h | 1 + linux-user/syscall.c | 3 +++ 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/dtc b/dtc index e54388015af1..2cdf93a6d402 160000 --- a/dtc +++ b/dtc @@ -1 +1 @@ -Subproject commit e54388015af1fb4bf04d0bca99caba1074d9cc42 +Subproject commit 2cdf93a6d402a161edf16de6011bd5ad76382e92 diff --git a/linux-user/irix/syscall_nr.h b/linux-user/irix/syscall_nr.h index 8004f610085b..90e14032ade6 100644 --- a/linux-user/irix/syscall_nr.h +++ b/linux-user/irix/syscall_nr.h @@ -267,6 +267,7 @@ /* syssgi(sysconf, cmd, ...) */ +#define TARGET_NR_sysconf_argmax (1) #define TARGET_NR_sysconf_childmax (2) #define TARGET_NR_sysconf_clktick (3) #define TARGET_NR_sysconf_openmax (5) diff --git a/linux-user/syscall.c b/linux-user/syscall.c index f9bc06a0ddbe..6fe50fbf9ce2 100644 --- a/linux-user/syscall.c +++ b/linux-user/syscall.c @@ -14520,6 +14520,9 @@ abi_long do_syscall(void *cpu_env, int num, abi_long arg1, case TARGET_NR_sysconf_mac: ret = 0; break; + case TARGET_NR_sysconf_argmax: + ret = get_errno(sysconf(_SC_ARG_MAX)); + break; default: gemu_log("qemu: Unsupported syscall: sysconf(%d)\n", (int)arg2); ret = -TARGET_ENOSYS;