Date: Sun, 24 Jan 2010 18:05:09 +0900 From: Hajimu UMEMOTO <ume@FreeBSD.org> To: Gabor Kovesdan <gabor@FreeBSD.org> Cc: Kostik Belousov <kostikbel@gmail.com>, attilio@FreeBSD.org, current@FreeBSD.org Subject: Re: NLS/strerror efficiency Message-ID: <ygezl43ub3u.wl%ume@mahoroba.org> In-Reply-To: <4B5B515C.9000109@FreeBSD.org> References: <20100119212019.GL59590@deviant.kiev.zoral.com.ua> <4B56CACF.50508@FreeBSD.org> <yge1vhgvdd3.wl%ume@mahoroba.org> <20100123193834.GM59590@deviant.kiev.zoral.com.ua> <4B5B515C.9000109@FreeBSD.org>
next in thread | previous in thread | raw e-mail | index | archive | help
Hi,
>>>>> On Sat, 23 Jan 2010 20:43:24 +0100
>>>>> Gabor Kovesdan <gabor@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 @ Internet Mutual Aid Society Yokohama, Japan
ume@mahoroba.org ume@{,jp.}FreeBSD.org
http://www.imasy.org/~ume/
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?ygezl43ub3u.wl%ume>
