Index | Thread | Search

From:
Alexandre Ratchov <alex@caoua.org>
Subject:
libsndio: Increase the sioctl_desc->display string size
To:
tech@openbsd.org
Date:
Mon, 15 Dec 2025 17:21:49 +0100

Download raw body.

Thread
Now that the display string contains the product name usb audio
interfaces, more than 12-bytes may be needed.

This requires a major library version bump. This is the opportunity to
increase other strings and add padding for future uses. FWIW this
change increases the sioctl_desc structure from 80B to 128B.

OK?

Index: include/sndio.h
===================================================================
RCS file: /cvs/src/include/sndio.h,v
diff -u -p -r1.15 sndio.h
--- include/sndio.h	24 May 2024 15:10:26 -0000	1.15
+++ include/sndio.h	15 Dec 2025 13:28:46 -0000
@@ -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 */
 };
 
Index: lib/libsndio/shlib_version
===================================================================
RCS file: /cvs/src/lib/libsndio/shlib_version,v
diff -u -p -r1.15 shlib_version
--- lib/libsndio/shlib_version	16 Jul 2025 15:33:05 -0000	1.15
+++ lib/libsndio/shlib_version	15 Dec 2025 13:28:46 -0000
@@ -1,2 +1,2 @@
-major=8
+major=9
 minor=0