From a7596b3f89a5246346c1d8b65d59e9562084601d Mon Sep 17 00:00:00 2001 From: ratchov Date: Thu, 22 Jan 2026 09:31:22 +0000 Subject: [PATCH] libsndio: Increase the length of display strings and control names Fixes truncated uaudio(4) device names. As we're at it, increase other strings and add padding in the sioctl_desc structure, for future use. --- include/sndio.h | 17 +++++------------ lib/libsndio/shlib_version | 4 ++-- 2 files changed, 7 insertions(+), 14 deletions(-) diff --git a/include/sndio.h b/include/sndio.h index 8832a2bcd6a..13d9b15bfc8 100644 --- a/include/sndio.h +++ b/include/sndio.h @@ -1,4 +1,4 @@ -/* $OpenBSD: sndio.h,v 1.16 2026/01/22 09:24:26 ratchov Exp $ */ +/* $OpenBSD: sndio.h,v 1.17 2026/01/22 09:31:22 ratchov Exp $ */ /* * Copyright (c) 2008 Alexandre Ratchov * @@ -27,17 +27,9 @@ /* * limits - * - * For now SIOCTL_DISPLAYMAX is 12 byte only. It nicely fits in the - * padding of the sioctl_desc structure: this allows any binary linked - * to the library version with no sioctl_desc->display to work with - * this library version. Currently, any string reported by the lower - * layers fits in the 12-byte buffer. Once larger strings start - * being used (or the ABI changes for any other reason) increase - * SIOCTL_DISPLAYMAX and properly pad the sioctl_desc structure. */ -#define SIOCTL_NAMEMAX 12 /* max name length */ -#define SIOCTL_DISPLAYMAX 12 /* max display string length */ +#define SIOCTL_NAMEMAX 16 /* max name length */ +#define SIOCTL_DISPLAYMAX 32 /* max display string length */ /* * private ``handle'' structure @@ -119,11 +111,12 @@ struct sioctl_desc { #define SIOCTL_LIST 5 /* switch, element of a list */ #define SIOCTL_SEL 6 /* element of a selector */ unsigned int type; /* one of above */ + unsigned int maxval; /* max value */ + int __pad[3]; /* for future use */ char func[SIOCTL_NAMEMAX]; /* function name, ex. "level" */ char group[SIOCTL_NAMEMAX]; /* group this control belongs to */ struct sioctl_node node0; /* affected node */ struct sioctl_node node1; /* dito for SIOCTL_{VEC,LIST,SEL} */ - unsigned int maxval; /* max value */ char display[SIOCTL_DISPLAYMAX]; /* free-format hint */ }; diff --git a/lib/libsndio/shlib_version b/lib/libsndio/shlib_version index 00604e64e7d..1c5d96eb2aa 100644 --- a/lib/libsndio/shlib_version +++ b/lib/libsndio/shlib_version @@ -1,2 +1,2 @@ -major=8 -minor=1 +major=9 +minor=0