From 3cc3d71efe299ed222dc2b6cd5af365ef35f76a7 Mon Sep 17 00:00:00 2001 From: Kyle Evans Date: Wed, 13 Nov 2024 21:05:22 -0600 Subject: [PATCH] libc: fix the stubs for pthread_{suspend,resume}_all_np Noticed just a little too late, stub_null returns a `void *` but these prototypes have no return value. As far as I know, all of our archs will throw the return value in a caller-saved register and it'll simply be ignored, but it's probably worth being more accurate. Fixes: 83aafcdc8892 ("libc, libthr: coordinate stubs for [...]") --- lib/libc/gen/_pthread_stubs.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/lib/libc/gen/_pthread_stubs.c b/lib/libc/gen/_pthread_stubs.c index 9df9ec9b8599..2a0cebadd5fd 100644 --- a/lib/libc/gen/_pthread_stubs.c +++ b/lib/libc/gen/_pthread_stubs.c @@ -50,6 +50,7 @@ struct pthread { static struct pthread main_thread; static int stub_main(void); +static void stub_void(void); static void *stub_null(void); static struct pthread *stub_self(void); static int stub_zero(void); @@ -132,8 +133,8 @@ pthread_func_entry_t __thr_jtable[PJT_MAX] = { [PJT_GETTHREADID_NP] = {PJT_DUAL_ENTRY(stub_zero)}, [PJT_ATTR_GET_NP] = {PJT_DUAL_ENTRY(stub_esrch)}, [PJT_GETNAME_NP] = {PJT_DUAL_ENTRY(stub_getname_np)}, - [PJT_SUSPEND_ALL_NP] = {PJT_DUAL_ENTRY(stub_null)}, - [PJT_RESUME_ALL_NP] = {PJT_DUAL_ENTRY(stub_null)}, + [PJT_SUSPEND_ALL_NP] = {PJT_DUAL_ENTRY(stub_void)}, + [PJT_RESUME_ALL_NP] = {PJT_DUAL_ENTRY(stub_void)}, }; /* @@ -302,6 +303,12 @@ stub_zero(void) return (0); } +static void +stub_void(void) +{ + +} + static void * stub_null(void) {