Re: Is clock_nanosleep() async-signal safe?
- From: Geoff Clare <geoff@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Tue, 27 Nov 2007 13:33:31 +0000
Spoon wrote:
The Open Group Base Specifications Issue 6 states:[...]
3.26 Async-Signal-Safe Function
A function that may be invoked, without restriction, from
signal-catching functions. No function is async-signal-safe unless
explicitly described as such.
The older Single UNIX Specification, Version 2 stated:
* When signal-catching functions are invoked asynchronously
with process execution, the behaviour of some of the functions defined
by this document is unspecified if they are called from a
signal-catching function.
The following table defines a set of interfaces that are
either reentrant or not interruptible by signals and are async-signal
safe. Therefore applications may invoke them, without restriction, from
signal-catching functions:
sigismember() signal() sigpending() sigprocmask() sigsuspend() sleep()[...]
All functions not in the above table are considered to be unsafe with
respect to signals.
sleep() used to be considered Async-Signal-Safe.
Is this not true anymore?
http://www.opengroup.org/onlinepubs/000095399/functions/sleep.html
(sleep is not explicitly described as Async-Signal-Safe.)
sleep() is still async-signal-safe. SUSv3 has much the same text, and
list of functions, that you quoted from SUSv2. See the end of XSH6
section 2.4.3.
Is clock_nanosleep() also not Async-Signal-Safe?
http://www.opengroup.org/onlinepubs/009695399/functions/clock_nanosleep.html
clock_nanosleep() is not in the list in XSH6 2.4.3, so it is not
async-signal-safe (neither is nanosleep()).
In general, is it legal to sleep in a signal handler?
Only using sleep().
--
Geoff Clare <netnews@xxxxxxxxxxxxx>
.
- Follow-Ups:
- Re: Is clock_nanosleep() async-signal safe?
- From: Spoon
- Re: Is clock_nanosleep() async-signal safe?
- References:
- Is clock_nanosleep() async-signal safe?
- From: Spoon
- Is clock_nanosleep() async-signal safe?
- Prev by Date: Re: termios/ioctl: What is the function to force a keystroke into a tty?
- Next by Date: Re: Fork Exec Pipe: HOW???
- Previous by thread: Is clock_nanosleep() async-signal safe?
- Next by thread: Re: Is clock_nanosleep() async-signal safe?
- Index(es):
Relevant Pages
|
|