_exit.c 716 B

12345678910111213141516171819202122232425262728293031
  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. #define _GNU_SOURCE
  10. #include <features.h>
  11. #include <errno.h>
  12. #include <unistd.h>
  13. #include <sys/types.h>
  14. #include <sys/syscall.h>
  15. libc_hidden_proto(_exit)
  16. #ifndef INLINE_SYSCALL
  17. #define INLINE_SYSCALL(name, nr, args...) __syscall_exit (args)
  18. #define __NR___syscall_exit __NR_exit
  19. static inline _syscall1(void, __syscall_exit, int, status);
  20. #endif
  21. void attribute_noreturn _exit(int status)
  22. {
  23. /* The loop is added only to keep gcc happy. */
  24. while(1)
  25. INLINE_SYSCALL(exit, 1, status);
  26. }
  27. libc_hidden_def(_exit)