From owner-freebsd-current@FreeBSD.ORG Sun Jan 24 09:05:16 2010 Return-Path: Delivered-To: current@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1291F106566C; Sun, 24 Jan 2010 09:05:16 +0000 (UTC) (envelope-from ume@mahoroba.org) Received: from asuka.mahoroba.org (ent.mahoroba.org [IPv6:2001:2f0:104:8010::1]) by mx1.freebsd.org (Postfix) with ESMTP id BB9BA8FC12; Sun, 24 Jan 2010 09:05:15 +0000 (UTC) Received: from yuga.mahoroba.org (ume@yuga.mahoroba.org [IPv6:2001:2f0:104:8010:21b:d3ff:fe38:5381]) (user=ume mech=CRAM-MD5 bits=0) by asuka.mahoroba.org (8.14.3/8.14.3) with ESMTP/inet6 id o0O95ArS030377 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sun, 24 Jan 2010 18:05:10 +0900 (JST) (envelope-from ume@mahoroba.org) Date: Sun, 24 Jan 2010 18:05:09 +0900 Message-ID: From: Hajimu UMEMOTO To: Gabor Kovesdan In-Reply-To: <4B5B515C.9000109@FreeBSD.org> References: <20100119212019.GL59590@deviant.kiev.zoral.com.ua> <4B56CACF.50508@FreeBSD.org> <20100123193834.GM59590@deviant.kiev.zoral.com.ua> <4B5B515C.9000109@FreeBSD.org> User-Agent: xcite1.58> Wanderlust/2.15.7 (Almost Unreal) SEMI/1.14.6 (Maruoka) FLIM/1.14.9 (=?ISO-2022-JP-2?B?R29qGyQoRCtXGyhC?=) APEL/10.7 Emacs/23.1 (i386-portbld-freebsd8.0) MULE/6.0 (HANACHIRUSATO) X-Operating-System: FreeBSD 8.0-STABLE X-PGP-Key: http://www.imasy.or.jp/~ume/publickey.asc X-PGP-Fingerprint: 1F00 0B9E 2164 70FC 6DC5 BF5F 04E9 F086 BF90 71FE Organization: Internet Mutual Aid Society, YOKOHAMA MIME-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=ISO-2022-JP-2 X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.3 (asuka.mahoroba.org [IPv6:2001:2f0:104:8010::1]); Sun, 24 Jan 2010 18:05:10 +0900 (JST) X-Virus-Scanned: clamav-milter 0.95.3 at asuka.mahoroba.org X-Virus-Status: Clean X-Spam-Status: No, score=-2.6 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on asuka.mahoroba.org Cc: Kostik Belousov , attilio@FreeBSD.org, current@FreeBSD.org Subject: Re: NLS/strerror efficiency X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 24 Jan 2010 09:05:16 -0000 Hi, >>>>> On Sat, 23 Jan 2010 20:43:24 +0100 >>>>> Gabor Kovesdan 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/