sigsuspend.c 966 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. /* vi: set sw=4 ts=4: */
  2. /*
  3. * sigsuspend() 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 <sys/syscall.h>
  10. #if defined __USE_POSIX
  11. #include <signal.h>
  12. extern __typeof(sigsuspend) __libc_sigsuspend;
  13. #ifdef __NR_rt_sigsuspend
  14. # define __NR___rt_sigsuspend __NR_rt_sigsuspend
  15. static __inline__ _syscall2(int, __rt_sigsuspend, const sigset_t *, mask, size_t, size)
  16. int __libc_sigsuspend(const sigset_t * mask)
  17. {
  18. return __rt_sigsuspend(mask, _NSIG / 8);
  19. }
  20. #else
  21. # define __NR___syscall_sigsuspend __NR_sigsuspend
  22. static __inline__ _syscall3(int, __syscall_sigsuspend, int, a, unsigned long int, b,
  23. unsigned long int, c)
  24. int __libc_sigsuspend(const sigset_t * set)
  25. {
  26. return __syscall_sigsuspend(0, 0, set->__val[0]);
  27. }
  28. #endif
  29. /* libc_hidden_proto(sigsuspend) */
  30. weak_alias(__libc_sigsuspend,sigsuspend)
  31. libc_hidden_weak(sigsuspend)
  32. #endif