Subject: xterm jump scrolling on sparc64
To: None <tech-x11@netbsd.org>
From: john heasley <heas@shrubbery.net>
List: tech-x11
Date: 05/30/2004 16:04:30
It has been mentioned a few times that jump scrolling of xterms on sparc64
(or rather any big endian LP64 host) does not work.  I've finally found the
problem:

Index: main.c
===================================================================
RCS file: /cvsroot/xsrc/xfree/xc/programs/xterm/main.c,v
retrieving revision 1.8
diff -u -r1.8 main.c
--- main.c      5 Mar 2004 17:16:16 -0000       1.8
+++ main.c      30 May 2004 22:39:18 -0000
@@ -4519,9 +4519,9 @@
 GetBytesAvailable(int fd)
 {
 #if defined(FIONREAD)
-    long arg;
-    ioctl(fd, FIONREAD, (char *) &arg);
-    return (int) arg;
+    int arg = 0;
+    ioctl(fd, FIONREAD, &arg);
+    return arg;
 #elif defined(__CYGWIN__)
     fd_set set;
     struct timeval timeout =

Question before I commit this though, what platform/OS takes a long for
FIONREAD?  SUS says int and but I found miscellaneous references on google
suggesting that there are some which use long (IRIX on LP64 and apprently
windows).

So, is that patch ok for our tree, given there doesn't appear to be an
existing X define to choose otherwise?