From d1331c6fb7da4cd8f7a5bb1bdf7ecda66b23add5 Mon Sep 17 00:00:00 2001 From: Michael Kerrisk Date: Sat, 22 Apr 2006 20:57:18 +0000 Subject: [PATCH] Noted that all threads should block signal being waited for. --- man2/sigwaitinfo.2 | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/man2/sigwaitinfo.2 b/man2/sigwaitinfo.2 index 3d888a364..a7f70fe24 100644 --- a/man2/sigwaitinfo.2 +++ b/man2/sigwaitinfo.2 @@ -21,12 +21,14 @@ .SH NAME sigwaitinfo, sigtimedwait \- synchronously wait for queued signals .SH SYNOPSIS +.nf .B #include .sp .BI "int sigwaitinfo(const sigset_t *" set ", siginfo_t *" info ");" .sp .BI "int sigtimedwait(const sigset_t *" set ", siginfo_t *" info ", " -.BI "const struct timespec *" timeout ");" +.BI " const struct timespec *" timeout ");" +.fi .SH DESCRIPTION .BR sigwaitinfo () suspends execution of the calling process until one of the signals in @@ -109,7 +111,7 @@ The wait was interrupted by a signal handler. .I timeout was invalid. .SH NOTES -In normal usage, the caller blocks the signals in +In normal usage, the calling program blocks the signals in .I set via a prior call to .BR sigprocmask () @@ -119,6 +121,12 @@ are delivered between successive calls to or .BR sigtimedwait ()) and does not establish handlers for these signals. +In a multithreaded program, +the signal should be blocked in all threads to prevent +the signal being delivered to a thread other than the one calling +.BR sigwaitinfo () +or +.BR sigtimedwait ()). .PP POSIX leaves the meaning of a NULL value for the .I timeout