From acbcdc035ecb6cec3d21a029caaa70416a7ebbe2 Mon Sep 17 00:00:00 2001 From: Patrick Grimm Date: Fri, 26 Dec 2025 13:30:03 +0100 Subject: [PATCH] Fixed linux compile with musl missing include asm/ioctls.h with error 'TCGETS2' undeclared The gcc warning "overflow in conversion from 'long unsigned int' to 'int' changes value from '2150388778' to '-2144578518' " can be surrpres wtith a musl patch https://gist.github.com/stargieg/3dbfe94b5776d9dfb3e14d18ee43aade from the musl mailing list with discussion on this bug, but no solution. [PATCH] ioctl: Fix implicit constant conversion overflow https://www.openwall.com/lists/musl/2024/06/01/1 --- ports/linux/termios2.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/ports/linux/termios2.h b/ports/linux/termios2.h index 7926b46b76..55a9f7ae30 100644 --- a/ports/linux/termios2.h +++ b/ports/linux/termios2.h @@ -2,6 +2,12 @@ #define TERMIOS2_H #define termios asmtermios /*avoid conflicts with others including termios.h*/ +/* for musl def TCGETS2 in asm-generic/ioctls.h */ +/* needs (int)sizeof(t) in _IOWR */ +/* asm-generic/ioctl.h */ +/* libc int ioctl (int, unsigned long int, ...) */ +/* musl int ioctl (int, int, ...) */ +#include #include #undef termios