posix_sigwaitinfo.cpp 658 B

1234567891011121314151617181920212223242526272829
  1. //
  2. // $Id$
  3. //
  4. #include<__vic/posix/thread.h>
  5. #include<__vic/throw_errno.h>
  6. #include<cerrno>
  7. namespace __vic { namespace posix {
  8. #ifdef __VIC_POSIX_RT__
  9. //----------------------------------------------------------------------------
  10. ::siginfo_t this_thread::sigwaitinfo(const ::sigset_t &set)
  11. {
  12. for(;;)
  13. {
  14. ::siginfo_t si;
  15. int sig_no = ::sigwaitinfo(&set, &si);
  16. if(sig_no >= 0) return si;
  17. int err = errno;
  18. if(err != EINTR) throw_errno("sigwaitinfo", err);
  19. // Interrupted by signal. Try again
  20. }
  21. }
  22. //----------------------------------------------------------------------------
  23. #endif
  24. }} // namespace