aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorQuentin Thébault <quentin.thebault@defenso.fr>2026-01-14 00:14:22 +0000
committerKyle Evans <kevans@FreeBSD.org>2026-01-14 00:15:30 +0000
commit5e1c7867e1b9a8abe7307d01087cddc057e39859 (patch)
tree85e1079ec09671ec29a4c0287fb7482bf8b82911
parent7669cbd0f06402573fe627e9e6f86c69cfd3d12b (diff)
vt(4): allow up to _SIG_MAXSIG (128) for VT_SETMODE
VT_SETMODE ioctl currently checks the provided signal numbers with its own ISSIGVALID macro that uses NSIG (32) as a maximum, although the code that will actually send the signal in sys/kern/kern_sig.c uses _SIG_VALID which allows up to _SIG_MAXSIG (128). This change aligns the vt code with the kernel internals and enables the use of higher signal numbers so that applications are not limited to SIGUSR1 and SIGUSR2 for vt release and acquire signals. Signed-off-by: Quentin Thébault <quentin.thebault@defenso.fr> Reviewed by: emaste, imp, kevans Differential Revision: https://reviews.freebsd.org/D53615
-rw-r--r--sys/dev/vt/vt.h1
-rw-r--r--sys/dev/vt/vt_core.c6
2 files changed, 3 insertions, 4 deletions
diff --git a/sys/dev/vt/vt.h b/sys/dev/vt/vt.h
index 8e35a81bc101..4abe99e4ab13 100644
--- a/sys/dev/vt/vt.h
+++ b/sys/dev/vt/vt.h
@@ -81,7 +81,6 @@
#else
#define DPRINTF(_l, ...) do {} while (0)
#endif
-#define ISSIGVALID(sig) ((sig) > 0 && (sig) < NSIG)
#define VT_SYSCTL_INT(_name, _default, _descr) \
int vt_##_name = (_default); \
diff --git a/sys/dev/vt/vt_core.c b/sys/dev/vt/vt_core.c
index 5e8f7b1d0bb7..a6a5f0eeff9d 100644
--- a/sys/dev/vt/vt_core.c
+++ b/sys/dev/vt/vt_core.c
@@ -3046,9 +3046,9 @@ skip_thunk:
DPRINTF(5, "reset WAIT_ACQ, ");
return (0);
} else if (mode->mode == VT_PROCESS) {
- if (!(ISSIGVALID(mode->relsig) &&
- ISSIGVALID(mode->acqsig) &&
- (mode->frsig == 0 || ISSIGVALID(mode->frsig)))) {
+ if (!(_SIG_VALID(mode->relsig) &&
+ _SIG_VALID(mode->acqsig) &&
+ (mode->frsig == 0 || _SIG_VALID(mode->frsig)))) {
DPRINTF(5, "error EINVAL\n");
return (EINVAL);
}