qemu

FORK: QEMU emulator
git clone https://git.neptards.moe/neptards/qemu.git
Log | Files | Refs | Submodules | LICENSE

safe-syscall-error.c (721B)


      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"
     13 #include "user/safe-syscall.h"
     14 
     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 }