git: 3cc3d71efe29 - main - libc: fix the stubs for pthread_{suspend,resume}_all_np
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Thu, 14 Nov 2024 03:08:33 UTC
The branch main has been updated by kevans: URL: https://cgit.FreeBSD.org/src/commit/?id=3cc3d71efe299ed222dc2b6cd5af365ef35f76a7 commit 3cc3d71efe299ed222dc2b6cd5af365ef35f76a7 Author: Kyle Evans <kevans@FreeBSD.org> AuthorDate: 2024-11-14 03:05:22 +0000 Commit: Kyle Evans <kevans@FreeBSD.org> CommitDate: 2024-11-14 03:08:02 +0000 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) {