[vlc-devel] commit: strerror(errno) is not thread-safe, use %m ( R??mi Denis-Courmont )

Anthony Loiseau thannoy at actech-innovation.com
Thu Oct 8 09:58:49 CEST 2009

As expected, I found a previous discussion on this topic :)
It tells about gettext.

Also, strerror man page contains two interesting sentences:
- "(The strerror_r() function) is similar to strerror(), but is thread
safe." (strerror_r: GNU extension)

- "This string must not be modified by the application, but may be
modified by a subsequent call to perror(3) or strerror()."
  (C99 do not name perror here but strerror is enough)

So right, if the standard allows the array pointed to by a strerror call
result to be modified by another call then there is no thread safety.

Thanks for having spotted me that.

On Wed, 2009-10-07 at 19:49 +0200, jpd at videolan.org wrote:
> On Wed, Oct 07, 2009 at 08:43:45PM +0300, R?mi Denis-Courmont wrote:
> > Le mercredi 7 octobre 2009 20:29:41 jpd at videolan.org, vous avez ?crit :
> > > On Wed, Oct 07, 2009 at 06:21:20PM +0300, R?mi Denis-Courmont wrote:
> > > > I can see you don't know what you're talking about.
> > > 
> > > Then do explain. Just being your charming self doesn't really help
> > > anyone, least of all you.
> > 
> > Did it ever occur to you that maybe the libc was NOT using static storage?
> > Did you ever check the logs for rationales on the strerror conversion?
> Come on, don't hold back. Spit it out, man. ``Check the logs'' is just
> lazyness. Give us a good explanation. I'm sure you can do it.
> _______________________________________________
> vlc-devel mailing list
> To unsubscribe or modify your subscription options:
> http://mailman.videolan.org/listinfo/vlc-devel

More information about the vlc-devel mailing list