--- freem/src/init.c	2025/01/19 02:04:04	1.1.1.1
+++ freem/src/init.c	2025/02/25 18:53:14	1.3
@@ -48,7 +48,12 @@
 #include <time.h>
 #include <errno.h>
 #include <sys/ioctl.h>
-#include <termios.h>
+
+#if defined(__sun) || defined(__FreeBSD__) || defined(__NetBSD__)
+# include <termio.h>
+#else
+# include <termios.h>
+#endif
 
 #include "config.h"