From b75055f7acd9cf8394fbe4494bb29371dc150cfb Mon Sep 17 00:00:00 2001 From: daniel Date: Mon, 23 Mar 2026 21:33:43 +0000 Subject: [PATCH] psignal(3): align the type of the signal parameter with POSIX POSIX uses an int for the signal number instead of an unsigned int. NetBSD made this change in 2010 and FreeBSD made this change in 2016. Follow suit with the other BSDs and match what POSIX specifies. This should not have an impact on the ABI and therefore no bump is needed. Flagged by Sortix os-test. ok deraadt@, millert@ --- include/signal.h | 4 ++-- lib/libc/gen/psignal.3 | 6 +++--- lib/libc/gen/psignal.c | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/include/signal.h b/include/signal.h index 07982bd75a1..d0a2b9af466 100644 --- a/include/signal.h +++ b/include/signal.h @@ -1,4 +1,4 @@ -/* $OpenBSD: signal.h,v 1.26 2018/05/30 13:20:38 bluhm Exp $ */ +/* $OpenBSD: signal.h,v 1.27 2026/03/23 21:33:43 daniel Exp $ */ /* $NetBSD: signal.h,v 1.8 1996/02/29 00:04:57 jtc Exp $ */ /*- @@ -132,7 +132,7 @@ int thrkill(pid_t _tid, int _signum, void *_tcb); int sigwait(const sigset_t *__restrict, int *__restrict); #endif #if __BSD_VISIBLE || __POSIX_VISIBLE >= 200809 -void psignal(unsigned int, const char *); +void psignal(int, const char *); #endif #endif /* __BSD_VISIBLE || __POSIX_VISIBLE || __XPG_VISIBLE */ __END_DECLS diff --git a/lib/libc/gen/psignal.3 b/lib/libc/gen/psignal.3 index 3fd2ebbf7bf..64dd573f8ad 100644 --- a/lib/libc/gen/psignal.3 +++ b/lib/libc/gen/psignal.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: psignal.3,v 1.14 2019/05/16 13:35:16 schwarze Exp $ +.\" $OpenBSD: psignal.3,v 1.15 2026/03/23 21:33:43 daniel Exp $ .\" .\" Copyright (c) 1983, 1991, 1993 .\" The Regents of the University of California. All rights reserved. @@ -27,7 +27,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd $Mdocdate: May 16 2019 $ +.Dd $Mdocdate: March 23 2026 $ .Dt PSIGNAL 3 .Os .Sh NAME @@ -38,7 +38,7 @@ .Sh SYNOPSIS .In signal.h .Ft void -.Fn psignal "unsigned int sig" "const char *s" +.Fn psignal "int sig" "const char *s" .Vt extern char *sys_siglist[]; .Vt extern char *sys_signame[]; .Sh DESCRIPTION diff --git a/lib/libc/gen/psignal.c b/lib/libc/gen/psignal.c index dca921d5a5a..5949c186cf0 100644 --- a/lib/libc/gen/psignal.c +++ b/lib/libc/gen/psignal.c @@ -1,4 +1,4 @@ -/* $OpenBSD: psignal.c,v 1.10 2015/08/31 02:53:57 guenther Exp $ */ +/* $OpenBSD: psignal.c,v 1.11 2026/03/23 21:33:43 daniel Exp $ */ /* * Copyright (c) 1983, 1993 * The Regents of the University of California. All rights reserved. @@ -40,7 +40,7 @@ #include void -psignal(unsigned int sig, const char *s) +psignal(int sig, const char *s) { static char buf[NL_TEXTMAX]; const char *c;