Richard Henderson | a3310c0 | 2021-11-15 14:08:52 +0100 | [diff] [blame] | 1 | /* |
| 2 | * safe-syscall-error.c: errno setting fragment |
| 3 | * This is intended to be invoked by safe-syscall.S |
| 4 | * |
| 5 | * Written by Richard Henderson <rth@twiddle.net> |
| 6 | * Copyright (C) 2021 Red Hat, Inc. |
| 7 | * |
| 8 | * This work is licensed under the terms of the GNU GPL, version 2 or later. |
| 9 | * See the COPYING file in the top-level directory. |
| 10 | */ |
| 11 | |
| 12 | #include "qemu/osdep.h" |
Richard Henderson | bbf15aa | 2021-11-17 16:14:00 +0100 | [diff] [blame] | 13 | #include "user/safe-syscall.h" |
Richard Henderson | a3310c0 | 2021-11-15 14:08:52 +0100 | [diff] [blame] | 14 | |
Richard Henderson | a3310c0 | 2021-11-15 14:08:52 +0100 | [diff] [blame] | 15 | /* |
| 16 | * This is intended to be invoked via tail-call on the error path |
| 17 | * from the assembly in host/arch/safe-syscall.inc.S. This takes |
| 18 | * care of the host specific addressing of errno. |
| 19 | * Return -1 to finalize the return value for safe_syscall_base. |
| 20 | */ |
| 21 | long safe_syscall_set_errno_tail(int value) |
| 22 | { |
| 23 | errno = value; |
| 24 | return -1; |
| 25 | } |