The branch stable/14 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=b3188948394e1fa5f2413857b5d1c5d4c449c13e
commit b3188948394e1fa5f2413857b5d1c5d4c449c13e Author: Konstantin Belousov <k...@freebsd.org> AuthorDate: 2025-05-16 13:18:21 +0000 Commit: Konstantin Belousov <k...@freebsd.org> CommitDate: 2025-05-26 08:16:35 +0000 libthr: add stable user interface for sigfastblock(2) (cherry picked from commit 31760ee65ae3e79434fb257d93e17a6de6021f48) --- include/pthread_np.h | 2 ++ lib/libthr/pthread.map | 2 ++ lib/libthr/thread/thr_sig.c | 19 +++++++++++++++++++ 3 files changed, 23 insertions(+) diff --git a/include/pthread_np.h b/include/pthread_np.h index dcc762156a67..a9e738540db4 100644 --- a/include/pthread_np.h +++ b/include/pthread_np.h @@ -59,6 +59,8 @@ int pthread_resume_np(pthread_t); int pthread_peekjoin_np(pthread_t, void **); void pthread_set_name_np(pthread_t, const char *); int pthread_setaffinity_np(pthread_t, size_t, const cpuset_t *); +void pthread_signals_block_np(void); +void pthread_signals_unblock_np(void); int pthread_single_np(void); void pthread_suspend_all_np(void); int pthread_suspend_np(pthread_t); diff --git a/lib/libthr/pthread.map b/lib/libthr/pthread.map index 76c574e783a2..4be126bcaabd 100644 --- a/lib/libthr/pthread.map +++ b/lib/libthr/pthread.map @@ -336,5 +336,7 @@ FBSD_1.6 { }; FBSD_1.8 { + pthread_signals_block_np; + pthread_signals_unblock_np; pthread_sigqueue; }; diff --git a/lib/libthr/thread/thr_sig.c b/lib/libthr/thread/thr_sig.c index 1e4a0b9a8f72..f43308d52327 100644 --- a/lib/libthr/thread/thr_sig.c +++ b/lib/libthr/thread/thr_sig.c @@ -37,6 +37,7 @@ #include <stdlib.h> #include <string.h> #include <pthread.h> +#include <pthread_np.h> #include "un-namespace.h" #include "libc_private.h" @@ -163,6 +164,24 @@ _thr_signal_block_setup(struct pthread *curthread) __sys_sigfastblock(SIGFASTBLOCK_SETPTR, &curthread->fsigblock); } +void +pthread_signals_block_np(void) +{ + struct pthread *curthread; + + curthread = _get_curthread(); + _thr_signal_block(curthread); +} + +void +pthread_signals_unblock_np(void) +{ + struct pthread *curthread; + + curthread = _get_curthread(); + _thr_signal_unblock(curthread); +} + int _thr_send_sig(struct pthread *thread, int sig) {