mirror of
https://github.com/qemu/qemu.git
synced 2024-12-15 07:23:52 +08:00
bbf15aaf7c
Move linux-user safe-syscall.S and safe-syscall-error.c to common-user so that bsd-user can also use it. Also move safe-syscall.h to include/user/. Since there is nothing here that is related to the guest, as opposed to the host, build it once. Reviewed-by: Warner Losh <imp@bsdimp.com> Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
26 lines
721 B
C
26 lines
721 B
C
/*
|
|
* safe-syscall-error.c: errno setting fragment
|
|
* This is intended to be invoked by safe-syscall.S
|
|
*
|
|
* Written by Richard Henderson <rth@twiddle.net>
|
|
* Copyright (C) 2021 Red Hat, Inc.
|
|
*
|
|
* This work is licensed under the terms of the GNU GPL, version 2 or later.
|
|
* See the COPYING file in the top-level directory.
|
|
*/
|
|
|
|
#include "qemu/osdep.h"
|
|
#include "user/safe-syscall.h"
|
|
|
|
/*
|
|
* This is intended to be invoked via tail-call on the error path
|
|
* from the assembly in host/arch/safe-syscall.inc.S. This takes
|
|
* care of the host specific addressing of errno.
|
|
* Return -1 to finalize the return value for safe_syscall_base.
|
|
*/
|
|
long safe_syscall_set_errno_tail(int value)
|
|
{
|
|
errno = value;
|
|
return -1;
|
|
}
|