Earlier today I found myself patching struct winsize to ttysize in
a port, because I had been confused by <sys/ioctl.h> into thinking
OpenBSD had the latter instead of the former. Ugh.
I think we can drop compatibility to SunOS < 3.2 (Sep 1986). FreeBSD
also got rid of this 4.5 years ago. I've verified that nothing
else in base trips over it. xenocara is fine, and I'll run a ports
bulk build and fix any fallout there.
ok?
Index: sys/sys/ioctl.h
===================================================================
RCS file: /cvs/src/sys/sys/ioctl.h,v
retrieving revision 1.13
diff -u -p -r1.13 ioctl.h
--- sys/sys/ioctl.h 4 Jul 2011 22:53:53 -0000 1.13
+++ sys/sys/ioctl.h 12 Dec 2013 20:16:38 -0000
@@ -41,23 +41,7 @@
#define _SYS_IOCTL_H_
#include <sys/ttycom.h>
-
-/*
- * Pun for SunOS prior to 3.2. SunOS 3.2 and later support TIOCGWINSZ
- * and TIOCSWINSZ (yes, even 3.2-3.5, the fact that it wasn't documented
- * nonwithstanding).
- */
-struct ttysize {
- unsigned short ts_lines;
- unsigned short ts_cols;
- unsigned short ts_xxx;
- unsigned short ts_yyy;
-};
-#define TIOCGSIZE TIOCGWINSZ
-#define TIOCSSIZE TIOCSWINSZ
-
#include <sys/ioccom.h>
-
#include <sys/filio.h>
#include <sys/sockio.h>
Index: lib/libocurses/setterm.c
===================================================================
RCS file: /cvs/src/lib/libocurses/setterm.c,v
retrieving revision 1.7
diff -u -p -r1.7 setterm.c
--- lib/libocurses/setterm.c 14 Aug 2005 17:15:19 -0000 1.7
+++ lib/libocurses/setterm.c 12 Dec 2013 20:28:54 -0000
@@ -81,7 +81,7 @@ setterm(type)
static char genbuf[1024];
static char __ttytype[1024];
register int unknown;
- struct ttysize win;
+ struct winsize win;
char *p;
#ifdef DEBUG
@@ -100,10 +100,10 @@ setterm(type)
#endif
/* Try TIOCGSIZE, and, if it fails, the termcap entry. */
- if (ioctl(STDERR_FILENO, TIOCGSIZE, &win) != -1 &&
- win.ts_lines != 0 && win.ts_cols != 0) {
- LINES = win.ts_lines;
- COLS = win.ts_cols;
+ if (ioctl(STDERR_FILENO, TIOCGWINSZ, &win) != -1 &&
+ win.ws_row != 0 && win.ws_col != 0) {
+ LINES = win.ws_row;
+ COLS = win.ws_col;
} else {
LINES = tgetnum("li");
COLS = tgetnum("co");
--
Christian "naddy" Weisgerber [email protected]