]> Git Repo - qemu.git/commit
linux-user: Move syscall error detection into safe_syscall_base
authorRichard Henderson <[email protected]>
Mon, 15 Nov 2021 13:08:52 +0000 (14:08 +0100)
committerRichard Henderson <[email protected]>
Mon, 20 Dec 2021 04:47:33 +0000 (20:47 -0800)
commita3310c0397e21df8f47cde3e55736104b9584d2d
tree2e550417028aea39886ba22f4b60fb9c88404630
parentb9d2af3c62c22870c02410d5c9c6d097ee0ddf3f
linux-user: Move syscall error detection into safe_syscall_base

The current api from safe_syscall_base() is to return -errno, which is
the interface provided by *some* linux kernel abis.  The wrapper macro,
safe_syscall(), detects error, stores into errno, and returns -1, to
match the api of the system syscall().

For those kernel abis that do not return -errno natively, this leads
to double syscall error detection.  E.g. Linux ppc64, which sets the
SO flag for error.

Simplify the usage from C by moving the error detection into assembly,
and usage from assembly by providing a C helper with which to set errno.

Reviewed-by: Warner Losh <[email protected]>
Signed-off-by: Richard Henderson <[email protected]>
linux-user/host/aarch64/safe-syscall.inc.S
linux-user/host/arm/safe-syscall.inc.S
linux-user/host/i386/safe-syscall.inc.S
linux-user/host/ppc64/safe-syscall.inc.S
linux-user/host/riscv/safe-syscall.inc.S
linux-user/host/s390x/safe-syscall.inc.S
linux-user/host/x86_64/safe-syscall.inc.S
linux-user/meson.build
linux-user/safe-syscall-error.c [new file with mode: 0644]
linux-user/safe-syscall.h
This page took 0.028387 seconds and 4 git commands to generate.