WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

Re: [Xen-devel] build error: strerror() ...

To: Keir Fraser <keir@xxxxxxxxxxxxx>
Subject: Re: [Xen-devel] build error: strerror() ...
From: "Daniel P. Berrange" <berrange@xxxxxxxxxx>
Date: Fri, 8 Dec 2006 22:08:15 +0000
Cc: Gerd Hoffmann <kraxel@xxxxxxx>, Xen devel list <xen-devel@xxxxxxxxxxxxxxxxxxx>
Delivery-date: Fri, 08 Dec 2006 14:08:18 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
In-reply-to: <C19F4508.5BF7%keir@xxxxxxxxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <45799208.4080600@xxxxxxx> <C19F4508.5BF7%keir@xxxxxxxxxxxxx>
Reply-to: "Daniel P. Berrange" <berrange@xxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mutt/1.4.1i
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 <string.h>

       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  -=| 

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel

<Prev in Thread] Current Thread [Next in Thread>