qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH] qemu-thread-posix: Fix build against older glib


From: Dr. David Alan Gilbert
Subject: Re: [Qemu-devel] [PATCH] qemu-thread-posix: Fix build against older glibc version
Date: Tue, 11 Mar 2014 16:13:01 +0000
User-agent: Mutt/1.5.21 (2010-09-15)

* Peter Maydell (address@hidden) wrote:
> On 11 March 2014 15:49, Jan Kiszka <address@hidden> wrote:
> > pthread_setname_np was introduced with 2.12.
> >
> > Signed-off-by: Jan Kiszka <address@hidden>
> > ---
> >  util/qemu-thread-posix.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/util/qemu-thread-posix.c b/util/qemu-thread-posix.c
> > index 45113b4..960d7f5 100644
> > --- a/util/qemu-thread-posix.c
> > +++ b/util/qemu-thread-posix.c
> > @@ -420,7 +420,7 @@ void qemu_thread_create(QemuThread *thread, const char 
> > *name,
> >      if (err)
> >          error_exit(err, __func__);
> >
> > -#ifdef _GNU_SOURCE
> > +#if defined(__GLIBC__) && (__GLIBC__ > 2 || (__GLIBC__ == 2 && 
> > __GLIBC_MINOR__ >= 12))
> >      if (name_threads) {
> >          pthread_setname_np(thread->thread, name);
> >      }
> > --
> > 1.8.1.1.298.ge7eed54
> 
> Can we have a configure test for the function instead, please?
> We don't generally do tests for specific glibc versions
> (among other things, glibc is not the only C library we
> might be compiled against -- consider MacOSX, the BSDs,
> and occasionally somebody tries to compile against one
> of the embedded libcs).

Except pthread_setname_np is not portable and was previously
ifdef'd _GNU_SOURCE anyway, and the parameters on other OSs
maybe different (freebsd has got a 3rd parameter for no
apparent reason).

Dave
--
Dr. David Alan Gilbert / address@hidden / Manchester, UK



reply via email to

[Prev in Thread] Current Thread [Next in Thread]