All the *-users generally use the Linux style of negative return codes
for errno. However, other systems, like FreeBSD, have a different
convention. Allow those systems to insert code after the syscall that
adjusts the return value of the system call to match the native linux
format.
Signed-off-by: Warner Losh <imp@bsdimp.com>
---
common-user/host/aarch64/safe-syscall.inc.S | 1 +
common-user/host/arm/safe-syscall.inc.S | 1 +
common-user/host/i386/safe-syscall.inc.S | 1 +
common-user/host/ppc64/safe-syscall.inc.S | 1 +
common-user/host/riscv/safe-syscall.inc.S | 1 +
common-user/host/s390x/safe-syscall.inc.S | 1 +
common-user/host/x86_64/safe-syscall.inc.S | 1 +
linux-user/safe-syscall.S | 1 +
8 files changed, 8 insertions(+)
diff --git a/common-user/host/aarch64/safe-syscall.inc.S
b/common-user/host/aarch64/safe-syscall.inc.S
index bc1f5a9792..81d83e8e79 100644
--- a/common-user/host/aarch64/safe-syscall.inc.S
+++ b/common-user/host/aarch64/safe-syscall.inc.S
@@ -64,6 +64,7 @@ safe_syscall_start:
svc 0x0
safe_syscall_end:
/* code path for having successfully executed the syscall */
+ ADJUST_SYSCALL_RETCODE
ret
0: