home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / std_unix / volume.26 / text0078.txt < prev    next >
Encoding:
Text File  |  1992-02-21  |  1.8 KB  |  56 lines

  1. Submitted-by: carl@umd5.umd.edu (Carl Symborski)
  2.  
  3. I am posting this for a friend.......
  4.  
  5. Carl
  6.  
  7. --------------------------------------------
  8.  
  9. I'm looking at Draft 5 (Dec. 7, 1990) of POSIX.4a and I have a question
  10. on sigwait() that hopefully someone out there in net-land can answer.
  11.  
  12. The first paragraph of the description (p. 112) says:
  13.  
  14.     "This function chooses a pending signal from set and atomically
  15.      both clears and returns that signal number.  If no signal in
  16.      set is pending at the time of the call, the thread shall be
  17.      suspended until one or more becomes pending.  The signals defined
  18.      by set shall be blocked when sigwait() returns.  The effect shall
  19.      be as if sigwait() leaves an unspecified signal handler routine
  20.      installed upon return."
  21.  
  22. What does it mean by "the signals defined by set shall be blocked when
  23. sigwait() returns?"  Does sigwait() actually call sigprocmask() to block
  24. the signal it just caught?  As an application writer, do I then have to
  25. call sigprocmask() afterwards to unblock the signal?  
  26.  
  27. Consider the following:
  28.  
  29.     (void) sigemptyset(&set);
  30.     (void) sigaddset(&set, SIGALRM);
  31.     (void) sigwait(&set);
  32.         .
  33.         .
  34.         .
  35.     (void) sigwait(&set);
  36.  
  37. Because I forgot to unblock SIGALRM, my thread is now deadlocked, right?
  38.  
  39. Of course I'm assuming that sigwait() will *not* choose a pending signal
  40. that's also blocked.  Section 8.4.6.2 on synchronous signal delivery states
  41. that applications may call sigprocmask() to examine or change (or both)
  42. the calling thread's signal mask.  If sigwait() chose blocked and unblocked
  43. signals, what would be the point of blocking signals while in synchronous
  44. delivery mode?
  45.  
  46. Can someone please explain the intent here?  Many thanks....
  47.  
  48. -- 
  49. Stephen Harpster
  50. Hughes Network Systems
  51. sharpster@hns.com
  52.  
  53.  
  54. Volume-Number: Volume 26, Number 89
  55.  
  56.