util/qemu-thread-posix.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
The pthread_get_name_np function is present on FreeBSD and OpenBSD
and has 'void' return not 'int'. We didn't notice this build problem
on FreeBSD since it also has pthread_getname_np which does return
int like Linux and we use the latter preferentially.
Fixes: 215235d365e49c72a85ea2940751e45419676031
Closes: https://gitlab.com/qemu-project/qemu/-/work_items/3399
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
---
This is a regression in the 11.0 release, but on the assumption it
is too late for further fixes, I'm CC'ing qemu-stable so this can
go into the future stable-11.0 branch
util/qemu-thread-posix.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/util/qemu-thread-posix.c b/util/qemu-thread-posix.c
index bd1c2ad2a5..089606c93f 100644
--- a/util/qemu-thread-posix.c
+++ b/util/qemu-thread-posix.c
@@ -568,7 +568,8 @@ const char *qemu_thread_get_name(void)
# if defined(CONFIG_PTHREAD_GETNAME_NP)
rv = pthread_getname_np(pthread_self(), namebuf, sizeof(namebuf));
# elif defined(CONFIG_PTHREAD_GET_NAME_NP)
- rv = pthread_get_name_np(pthread_self(), namebuf, sizeof(namebuf));
+ pthread_get_name_np(pthread_self(), namebuf, sizeof(namebuf));
+ rv = 0;
# else
rv = -1;
# endif
--
2.53.0
On 17/4/26 14:05, Daniel P. Berrangé wrote: > The pthread_get_name_np function is present on FreeBSD and OpenBSD > and has 'void' return not 'int'. We didn't notice this build problem > on FreeBSD since it also has pthread_getname_np which does return > int like Linux and we use the latter preferentially. > > Fixes: 215235d365e49c72a85ea2940751e45419676031 > Closes: https://gitlab.com/qemu-project/qemu/-/work_items/3399 > Signed-off-by: Daniel P. Berrangé <berrange@redhat.com> > --- > > This is a regression in the 11.0 release, but on the assumption it > is too late for further fixes, I'm CC'ing qemu-stable so this can > go into the future stable-11.0 branch > > util/qemu-thread-posix.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/util/qemu-thread-posix.c b/util/qemu-thread-posix.c > index bd1c2ad2a5..089606c93f 100644 > --- a/util/qemu-thread-posix.c > +++ b/util/qemu-thread-posix.c > @@ -568,7 +568,8 @@ const char *qemu_thread_get_name(void) > # if defined(CONFIG_PTHREAD_GETNAME_NP) > rv = pthread_getname_np(pthread_self(), namebuf, sizeof(namebuf)); > # elif defined(CONFIG_PTHREAD_GET_NAME_NP) > - rv = pthread_get_name_np(pthread_self(), namebuf, sizeof(namebuf)); > + pthread_get_name_np(pthread_self(), namebuf, sizeof(namebuf)); > + rv = 0; > # else > rv = -1; > # endif Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
On 17/04/2026 14.05, Daniel P. Berrangé wrote: > The pthread_get_name_np function is present on FreeBSD and OpenBSD > and has 'void' return not 'int'. We didn't notice this build problem > on FreeBSD since it also has pthread_getname_np which does return > int like Linux and we use the latter preferentially. > > Fixes: 215235d365e49c72a85ea2940751e45419676031 > Closes: https://gitlab.com/qemu-project/qemu/-/work_items/3399 > Signed-off-by: Daniel P. Berrangé <berrange@redhat.com> > --- > > This is a regression in the 11.0 release, but on the assumption it > is too late for further fixes, I'm CC'ing qemu-stable so this can > go into the future stable-11.0 branch > > util/qemu-thread-posix.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/util/qemu-thread-posix.c b/util/qemu-thread-posix.c > index bd1c2ad2a5..089606c93f 100644 > --- a/util/qemu-thread-posix.c > +++ b/util/qemu-thread-posix.c > @@ -568,7 +568,8 @@ const char *qemu_thread_get_name(void) > # if defined(CONFIG_PTHREAD_GETNAME_NP) > rv = pthread_getname_np(pthread_self(), namebuf, sizeof(namebuf)); > # elif defined(CONFIG_PTHREAD_GET_NAME_NP) > - rv = pthread_get_name_np(pthread_self(), namebuf, sizeof(namebuf)); > + pthread_get_name_np(pthread_self(), namebuf, sizeof(namebuf)); > + rv = 0; > # else > rv = -1; > # endif Reviewed-by: Thomas Huth <thuth@redhat.com>
© 2016 - 2026 Red Hat, Inc.