From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Daniel P. Berrange" Subject: Re: build error: strerror() ... Date: Fri, 8 Dec 2006 22:08:15 +0000 Message-ID: <20061208220815.GE4742@redhat.com> References: <45799208.4080600@suse.de> Reply-To: "Daniel P. Berrange" Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Content-Disposition: inline In-Reply-To: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Keir Fraser Cc: Gerd Hoffmann , Xen devel list List-Id: xen-devel@lists.xenproject.org On Fri, Dec 08, 2006 at 04:36:24PM +0000, Keir Fraser wrote: > > strerror_r() sucks. I removed it and used a pthread mutex instead. If you '#define _XOPEN_SOURCE 600' then glibc will provide the standards compliant version of strerror_r which always uses the user supplied buffer. Seems simpler than rolling our own code using pthreads mutexes. [quote strerror_r(3)] #define _XOPEN_SOURCE 600 #include int strerror_r(int errnum, char *buf, size_t buflen); /* XSI-compliant strerror_r() */ ..... The XSI-compliant strerror_r() is preferred for portable applications. It returns the error string in the user-supplied buffer buf of length buflen. [/quote] Regards, 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 -=|