__syscall_error.c 465 B

12345678910111213141516171819
  1. /* Wrapper for setting errno.
  2. *
  3. * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
  4. *
  5. * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
  6. */
  7. #include <errno.h>
  8. #include <features.h>
  9. /* This routine is jumped to by all the syscall handlers, to stash
  10. * an error number into errno. */
  11. int __syscall_error(void) attribute_hidden;
  12. int __syscall_error(void)
  13. {
  14. register int err_no asm("%r8");
  15. __set_errno(-err_no);
  16. return -1;
  17. }