2
0

safe-syscall-error.c 721 B

12345678910111213141516171819202122232425
  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. #include "qemu/osdep.h"
  12. #include "user/safe-syscall.h"
  13. /*
  14. * This is intended to be invoked via tail-call on the error path
  15. * from the assembly in host/arch/safe-syscall.inc.S. This takes
  16. * care of the host specific addressing of errno.
  17. * Return -1 to finalize the return value for safe_syscall_base.
  18. */
  19. long safe_syscall_set_errno_tail(int value)
  20. {
  21. errno = value;
  22. return -1;
  23. }