home *** CD-ROM | disk | FTP | other *** search
- Submitted-by: carl@umd5.umd.edu (Carl Symborski)
-
- I am posting this for a friend.......
-
- Carl
-
- --------------------------------------------
-
- I'm looking at Draft 5 (Dec. 7, 1990) of POSIX.4a and I have a question
- on sigwait() that hopefully someone out there in net-land can answer.
-
- The first paragraph of the description (p. 112) says:
-
- "This function chooses a pending signal from set and atomically
- both clears and returns that signal number. If no signal in
- set is pending at the time of the call, the thread shall be
- suspended until one or more becomes pending. The signals defined
- by set shall be blocked when sigwait() returns. The effect shall
- be as if sigwait() leaves an unspecified signal handler routine
- installed upon return."
-
- What does it mean by "the signals defined by set shall be blocked when
- sigwait() returns?" Does sigwait() actually call sigprocmask() to block
- the signal it just caught? As an application writer, do I then have to
- call sigprocmask() afterwards to unblock the signal?
-
- Consider the following:
-
- (void) sigemptyset(&set);
- (void) sigaddset(&set, SIGALRM);
- (void) sigwait(&set);
- .
- .
- .
- (void) sigwait(&set);
-
- Because I forgot to unblock SIGALRM, my thread is now deadlocked, right?
-
- Of course I'm assuming that sigwait() will *not* choose a pending signal
- that's also blocked. Section 8.4.6.2 on synchronous signal delivery states
- that applications may call sigprocmask() to examine or change (or both)
- the calling thread's signal mask. If sigwait() chose blocked and unblocked
- signals, what would be the point of blocking signals while in synchronous
- delivery mode?
-
- Can someone please explain the intent here? Many thanks....
-
- --
- Stephen Harpster
- Hughes Network Systems
- sharpster@hns.com
-
-
- Volume-Number: Volume 26, Number 89
-
-