Re: NLS/strerror efficiency

From: Hajimu UMEMOTO <ume_at_FreeBSD.org>
Date: Sun, 24 Jan 2010 18:05:09 +0900
Hi,

>>>>> On Sat, 23 Jan 2010 20:43:24 +0100
>>>>> Gabor Kovesdan <gabor_at_FreeBSD.org> said:

gabor> El 2010. 01. 23. 20:38, Kostik Belousov escribi$(D+Q(B:
> Wouldn't this cause the locale for error strings to be fixated at the
> time of the first strerror/gai_strerror call ?
>
> Current code, despite it inefficiency, allow dynamic change of locale
> that is reflected in strerror() output, I believe.

Yes, you are right.  I didn't notice the situation that locale might
be changed dynamically.  We need to save current locale to adapt to
the situation.
    
gabor> That's a good point. Imho, it should be cached in another static 
gabor> variable just like in my patch, where I should store it in another 
gabor> member of the struct.

It seems difficult to save the current locale outside of the cat*(3)
without race condition.  We need to handle it inside of the cat*(3).
Perhaps, your approach is correct.

Sincerely,

--
Hajimu UMEMOTO _at_ Internet Mutual Aid Society Yokohama, Japan
ume_at_mahoroba.org  ume_at_{,jp.}FreeBSD.org
http://www.imasy.org/~ume/
Received on Sun Jan 24 2010 - 08:05:16 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:40:00 UTC