+Mon Jan 24 12:57:18 1994 Jim Meyering (meyering@comco.com)
+
+ * stty.c (set_window_size): Work around SunOS 4.x kernel bug that
+ makes `stty rows 34 cols 80;stty rows 0;stty cols 0' incorrectly
+ set rows to 80 and columns to 0. Sun's stty has this problem, too.
+ The kernel bug is fixed in Solaris 2. Mostly from Alexander Dupuy
+ <dupuy@cs.columbia.edu>.
+
+Thu Jan 13 17:27:38 1994 Jim Meyering (meyering@comco.com)
+
+ * src/Makefile.in: Change all link commands to use both $(CFLAGS)
+ and $(LDFLAGS).
+
+Mon Jan 10 01:20:38 1994 Jim Meyering (meyering@comco.com)
+
+ * man/Makefile.in (manprefix): Use binprefix as the default.
+
+Thu Jan 06 18:19:06 1994 Jim Meyering (meyering@comco.com)
+
+ * who.c (print_entry): Prepend `/dev/' only if ut_line is not
+ already an absolute filename. Just to be safe.
+
Fri Dec 31 00:22:59 1993 Jim Meyering (meyering@comco.com)
* date.c (usage): Reorder listing of % formats in `sort -f' order.
if (cols >= 0)
win.ws_col = cols;
}
+
+#ifdef TIOCSSIZE
+ /* The following code deals with a bug in the SunOS 4.x (and 3.x?) kernel.
+ This comment from sys/ttold.h describes Sun's twisted logic - a better
+ test would have been (ts_lines > 64k || ts_cols > 64k || ts_cols == 0).
+ At any rate, the problem is gone in Solaris 2.x.
+
+ Unfortunately, the old TIOCSSIZE code does collide with TIOCSWINSZ,
+ but they can be disambiguated by checking whether a "struct ttysize"
+ structure's "ts_lines" field is greater than 64K or not. If so,
+ it's almost certainly a "struct winsize" instead.
+
+ At any rate, the bug manifests itself when ws_row == 0; the symptom is
+ that ws_row is set to ws_col, and ws_col is set to (ws_xpixel<<16) +
+ ws_ypixel. Since GNU stty sets rows and columns separately, this bug
+ caused "stty rows 0 cols 0" to set rows to cols and cols to 0, while
+ "stty cols 0 rows 0" would do the right thing. On a little-endian
+ machine like the sun386i, the problem is the same, but for ws_col == 0.
+
+ The workaround is to do the ioctl once with row and col = 1 to set the
+ pixel info, and then do it again using a TIOCSSIZE to set rows/cols. */
+
+ if (win.ws_row == 0 || win.ws_col == 0)
+ {
+ struct ttysize ttysz;
+
+ ttysz.ts_lines = win.ws_row;
+ ttysz.ts_cols = win.ws_col;
+
+ win.ws_row = 1;
+ win.ws_col = 1;
+
+ if (ioctl (0, TIOCSWINSZ, (char *) &win))
+ error (1, errno, "standard input");
+
+ if (ioctl (0, TIOCSSIZE, (char *) &ttysz))
+ error (1, errno, "standard input");
+ return;
+ }
+#endif
+
if (ioctl (0, TIOCSWINSZ, (char *) &win))
error (1, errno, "standard input");
}