From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Daniel P. Berrange" Subject: Re: Re: Error reporting capabilities for libxc Date: Mon, 23 Oct 2006 21:57:30 +0100 Message-ID: <20061023205730.GI25795@redhat.com> References: <453D1554.8000202@us.ibm.com> <20061023192753.GG25795@redhat.com> <3AAA99889D105740BE010EB6D5A5A3B205073B@paddington.ad.cl.cam.ac.uk> Reply-To: "Daniel P. Berrange" Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Content-Disposition: inline In-Reply-To: <3AAA99889D105740BE010EB6D5A5A3B205073B@paddington.ad.cl.cam.ac.uk> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Ian Pratt Cc: Anthony Liguori , xen-devel@lists.xensource.com List-Id: xen-devel@lists.xenproject.org On Mon, Oct 23, 2006 at 09:54:12PM +0100, Ian Pratt wrote: > > One further issue I've thought of is that the __thread annotation does > > not provide any way to do cleanup when a thread exists. Fine if the > > per-thread variable is a simple scalar, but not so good if its a char > * > > since I think it'll leak memory. So I think I may have no choice by to > > re-write with pthread_getspecific(), since that allows registration > > of a cleanup function to free memory. > > Do we actually need pointers? I'd much rather go with __thread. Well, we need a char buffer to store the error message, since that has much more useful info than the error code alone. I could always just do a fixed 200 byte buffer, and truncate anything longer than this which would also actually remove the annoying OOM problem in copying the error message. Dan. -- |=- Red Hat, Engineering, Emerging Technologies, Boston. +1 978 392 2496 -=| |=- Perl modules: http://search.cpan.org/~danberr/ -=| |=- Projects: http://freshmeat.net/~danielpb/ -=| |=- GnuPG: 7D3B9505 F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 -=|