Return-Path: Delivered-To: apmail-harmony-dev-archive@www.apache.org Received: (qmail 9831 invoked from network); 9 Dec 2008 13:05:11 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 9 Dec 2008 13:05:11 -0000 Received: (qmail 97562 invoked by uid 500); 9 Dec 2008 13:05:22 -0000 Delivered-To: apmail-harmony-dev-archive@harmony.apache.org Received: (qmail 97521 invoked by uid 500); 9 Dec 2008 13:05:22 -0000 Mailing-List: contact dev-help@harmony.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@harmony.apache.org Delivered-To: mailing list dev@harmony.apache.org Received: (qmail 97510 invoked by uid 99); 9 Dec 2008 13:05:22 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 09 Dec 2008 05:05:22 -0800 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of t.p.ellison@gmail.com designates 66.249.92.171 as permitted sender) Received: from [66.249.92.171] (HELO ug-out-1314.google.com) (66.249.92.171) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 09 Dec 2008 13:05:08 +0000 Received: by ug-out-1314.google.com with SMTP id m2so881593ugc.22 for ; Tue, 09 Dec 2008 05:04:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from :user-agent:mime-version:to:subject:references:in-reply-to :x-enigmail-version:content-type:content-transfer-encoding; bh=XZqo7u4q3obLrGEYyA7YdeaEIdYTrC7j6UyqqBH75CI=; b=CgcngnfyF+abR8Jy13MYvYcc6VGxSthgWZb8lbiVoDad9WtishLV6WSNqMoCu5Ez8T BCv0C06CfWiwFmIZIQhFuNSF/OgQ0i9U7IahHEnNkSG1iA3CaRHzYGH8NPsHstXMIW3L BUc7lyCxfQ0diQdyDC3871EKvIVQJnGYBO6GE= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:x-enigmail-version:content-type :content-transfer-encoding; b=OWrp+Aa0pJi33p9ZuyQRWZ0zSrDueki1Smb0JwrFOd6m9tYSn6HtQpWC7yuYq4wt2T Tmj5XKHVnjp3LcXLl/dCkzbzaKpT7uI/Og8C+syXn3hm+54JJcULZ9/aiDX1Sm9B9TOE 3O0yfj5LftPiOX6FFRxSniAyPTBy/FobR6IkU= Received: by 10.67.20.11 with SMTP id x11mr3231414ugi.68.1228827885634; Tue, 09 Dec 2008 05:04:45 -0800 (PST) Received: from ?9.20.183.162? (blueice2n1.uk.ibm.com [195.212.29.75]) by mx.google.com with ESMTPS id 6sm6871525ugc.39.2008.12.09.05.04.44 (version=SSLv3 cipher=RC4-MD5); Tue, 09 Dec 2008 05:04:44 -0800 (PST) Message-ID: <493E6CEA.3070208@gmail.com> Date: Tue, 09 Dec 2008 13:04:42 +0000 From: Tim Ellison User-Agent: Thunderbird 2.0.0.18 (Windows/20081105) MIME-Version: 1.0 To: dev@harmony.apache.org Subject: Re: [classlib] [luni] Should Improve File System Exception Messages References: <297100561.1228445444854.JavaMail.jira@brutus> <70c713190812041903i5ca0920agee58291279d007fd@mail.gmail.com> <4938AE77.80706@gmail.com> <4938D9B3.3080307@gmail.com> <49395A0E.5090009@gmail.com> <493DE6FF.5000108@gmail.com> In-Reply-To: <493DE6FF.5000108@gmail.com> X-Enigmail-Version: 0.95.7 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org Regis wrote: > I found readImpl and writeImpl in OSFileSystem.c use > > netLookupErrorString(env, HYPORT_ERROR_FILE_LOCKED) > > to get error messages, which are hard coded in nethelp.c, my questions are: > > 1. why does file read/write need to get error messages from nethelp.c? > We already have hyfile_error_message() can do that. HYPORT_ERROR_* messges are platform independent so you can pass them around in common code. You should not use hyfile_error_message() since it is not thread safe - i.e. you might get back an error/success for a different thread's file operation. Its use is deprecated. > 2. error messages are hard coded in netLookupErrorString, is that expected? That is used to map from the HYPORT_ERROR_* messages to a display string, so yes it is expected, but maybe not what we want to use here. In general, portlib functions that make OS calls set a per-thread error code (using hyerror_set_last_error()), and the users of the portlib retrieve it using hyerror_last_error_number() and the corresponding display string using hyerror_last_error_message(). Take a look at the portlib functions in hyerror.c Regards, Tim