All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Daniel P. Berrange" <berrange@redhat.com>
To: Keir Fraser <keir@xensource.com>
Cc: Gerd Hoffmann <kraxel@suse.de>,
	Xen devel list <xen-devel@lists.xensource.com>
Subject: Re: build error: strerror() ...
Date: Fri, 8 Dec 2006 22:08:15 +0000	[thread overview]
Message-ID: <20061208220815.GE4742@redhat.com> (raw)
In-Reply-To: <C19F4508.5BF7%keir@xensource.com>

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

  reply	other threads:[~2006-12-08 22:08 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-12-08 16:25 build error: strerror() Gerd Hoffmann
2006-12-08 16:36 ` Keir Fraser
2006-12-08 22:08   ` Daniel P. Berrange [this message]
2006-12-09  8:59     ` Keir Fraser

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20061208220815.GE4742@redhat.com \
    --to=berrange@redhat.com \
    --cc=keir@xensource.com \
    --cc=kraxel@suse.de \
    --cc=xen-devel@lists.xensource.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.