_exit.c 689 B

12345678910111213141516171819202122232425262728293031323334
  1. /* vi: set sw=4 ts=4: */
  2. /*
  3. * exit syscall for uClibc
  4. *
  5. * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
  6. *
  7. * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
  8. */
  9. #include <features.h>
  10. #include <errno.h>
  11. #include <unistd.h>
  12. #include <sys/types.h>
  13. #include <sys/syscall.h>
  14. #ifdef __UCLIBC_HAS_THREADS_NATIVE__
  15. #include <sysdep.h>
  16. #endif
  17. void attribute_noreturn _exit(int status)
  18. {
  19. /* The loop is added only to keep gcc happy. */
  20. while(1)
  21. {
  22. #ifdef __UCLIBC_HAS_THREADS_NATIVE__
  23. # ifdef __NR_exit_group
  24. INLINE_SYSCALL(exit_group, 1, status);
  25. # endif
  26. #endif
  27. INLINE_SYSCALL(exit, 1, status);
  28. }
  29. }
  30. libc_hidden_def(_exit)
  31. weak_alias(_exit,_Exit)