IEEE Std 1003.1-2001 Interpretation #30

Copyright © 2006 IEEE. All rights reserved.

Interpretation Number:	030
                  	Topic:			sigpause and use in threaded applications
                    	Relevant Sections:	XSH sigpause

------------------------------------------------------------------------

7 Defect Report concerning (number and title of International Standard or DIS final text, if applicable):

The System Interfaces volume of IEEE Std 1003.1-2001

------------------------------------------------------------------------

8 Qualifier (e.g. error, omission, clarification required):

1. Error

------------------------------------------------------------------------

9 References in document (e.g. page, clause, figure, and/or table numbers):

Edition of Specification (Year): 2004 Page: 1376 Line: 43040 Section: sighold

Reference xshbug2.txt ERN 42

------------------------------------------------------------------------

10 Nature of defect (complete, concise explanation of the perceived problem):

There are some problems with how sigpause() is specified with respect to threads.

The main issue is that the sighold() page (on which sigpause() is described) says "Use of any of these functions is unspecified in a multi-threaded process", and yet sigpause() is included in the list in 2.9.5.2 Cancellation Points of functions for which a cancellation point shall occur. If the use of sigpause() in a multi-threaded process is unspecified, there is no point in requiring that it contains a cancellation point.

Under the DESCRIPTION heading on the sighold() page it says, "The sigpause() function shall remove sig from the calling process' signal mask and suspend the calling process until a signal is received". Since it uses "process" here instead of "thread", this is consistent with the use of sigpause() in multi-threaded processes being unspecified. However, later under the RETURN VALUE heading it uses "thread" instead of "process": "The sigpause() function shall suspend execution of the thread until a signal is received".

------------------------------------------------------------------------

11 Solution proposed by the submitter (optional):

Either update the sighold() page appropriately so that the behaviour of sigpause() in multi-threaded processes is specified, or change "thread" to "process" under the RETURN VALUE heading and move sigpause() from the "shall" list to the "may" list in 2.9.5.2 Cancellation Points.

------------------------------------------------------------------------

Interpretation response ------------------------ The standard is unclear on this issue, and no conformance distinction can be made between alternative implementations in their use of sigpause in thread applications based on this. This is being referred to the sponsor.

Rationale: --------- None.

Notes to the Editor (not part of this interpretation): ----------------------------------------------------- In the next revision we should either deprecate these functions or define them to be thread-safe. This rdvk should be copied to SD/5.

Background notes on sigpause and related functions and their modern analogs:

Each of these historic functions has a direct analog in the modern POSIX functions which are required to be per-thread and thread-safe (aside from sigprocmask, which is replaced by pthread_sigmask). They thus could be required to be thread-safe too.

sigset is a simple wrapper for sigaction. sighold is sigprocmask/pthread_sigmask with SIG_BLOCK. sigignore is sigaction with SIG_IGN. sigpause is sigsuspend. sigrelse is sigprocmask/pthread_sigmask with SIG_UNBLOCK.

Back to IEEE Standards Interpretations for IEEE Std 1003.1-2001