NLS/strerror efficiency

Hajimu UMEMOTO ume at FreeBSD.org
Sun Jan 24 09:05:16 UTC 2010


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ó:
> 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 @ Internet Mutual Aid Society Yokohama, Japan
ume at mahoroba.org  ume@{,jp.}FreeBSD.org
http://www.imasy.org/~ume/


More information about the freebsd-current mailing list