It is currently Sat, 30 May 2020 11:38:56 GMT

Author Message
 Why is localtime_r() not ASYNC-SIGNAL-safe ?
Can anybody tell me what happens in a call to localtime_r()?
Using localtime_r() in main code AND in signal handler can cause SEGV.
Using the reentrant version of this call I did not expect such kind of problems.

Silvia Winkler

 Sat, 28 Sep 2002 03:00:00 GMT   
 Why is localtime_r() not ASYNC-SIGNAL-safe ?

localtime_r() is thread-safe, which is not the same as

"reentrant" is a somewhat loose term, often used to mean thread-safety.

 Sat, 28 Sep 2002 03:00:00 GMT   
 Why is localtime_r() not ASYNC-SIGNAL-safe ?

It may still need to call malloc() or lock some global state.

Expressed in this posting are my opinions.  They are in no way related
to opinions held by my employer, Sun Microsystems.
Statements on Sun products included here are not gospel and may
be fiction rather than truth.

 Sat, 28 Sep 2002 03:00:00 GMT   
 Why is localtime_r() not ASYNC-SIGNAL-safe ?

it seems to me that localtime_r should be made to be async signal safe
because it is rather useful to be able to determine the time when a
signal is generated in a process. I.e for logging the time of the
exceptional event.

What I have seen using pstack on a proces is that that localtime_r
does ultimatly depend on some timezone routines that do malloc().
Which obviously isn't async signal safe.

 Fri, 04 Oct 2002 03:00:00 GMT   
   [ 4 post ] 

Similar Threads

1. siglongjmp not async-signal-safe?

2. poll/select not async-signal safe

3. Delivery of signals when thread not async safe

4. What is async-signal safe function

5. To async or not not async

6. Why am I getting kill by signal 11...randomly

7. Thread-safe and Signal-safe

8. mmap, thread-safe, and signal-safe

9. Solaris 8 threads: If a routine is Async-Signal-Safe is it also thread Safe?

Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by ST Software