[asterisk-dev] strerror() or strerror_r() ?

Tony Mountifield tony at softins.clara.co.uk
Mon Dec 11 04:15:49 MST 2006


I was looking up the man page for strerror(), and found that there is
an alternative, strerror_r(), which is described as thread-safe, using
a buffer passed in from the caller instead of a static buffer.

Despite asterisk being heavily multi-threaded, it uses strerror() in
many places. Although it's unlikely, I guess there could be a problem
if two threads need to report an error simultaneously.

Comments?

Cheers
Tony
-- 
Tony Mountifield
Work: tony at softins.co.uk - http://www.softins.co.uk
Play: tony at mountifield.org - http://tony.mountifield.org


More information about the asterisk-dev mailing list