Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!uunet!seismo!husc6!rutgers!ames!ucbcad!ucbvax!decvax!decwrl!pyramid!uccba!hal!ncoast!allbery From: allbery@ncoast.UUCP (Brandon Allbery) Newsgroups: comp.emacs Subject: Re: JOVE and/or GNU-MACS for 386/IX Message-ID: <4096@ncoast.UUCP> Date: Fri, 7-Aug-87 23:12:25 EDT Article-I.D.: ncoast.4096 Posted: Fri Aug 7 23:12:25 1987 Date-Received: Sun, 9-Aug-87 11:19:10 EDT References: <184@titn.TITN> Reply-To: allbery@ncoast.UUCP (Brandon Allbery) Followup-To: comp.emacs Organization: Cleveland Public Access UN*X, Cleveland, Oh Lines: 85 As quoted from <184@titn.TITN> by jordan@titn.TITN (Jordan Bortz): +--------------- | Has anyone done a port of jove or gnu-macs for the 386 running Ineractive | Systems 386/IX (V.3)?? I'm really looking for gnumacs, and would like to | bench it (and use LISP funcs!), but am using jove now, which I compiled | on the 386. | | It seems to work okay, except that running processes in windows doesn't | work, and a make-to-buffer gives a Read Error 4. Does anyone have | the patches for jove?? +--------------- This bug in JOVE happens on any non-BSD system. BSD has the property of automatically restarting interrupted read()s on slow devices; others don't, and the read() function returns -1 with errno == EINTR (4). I don't have the fixes online. Basically, however, I changed the call to read() in _filbuf (? -- the function called by getc(); it's in fp.c) to xread(), and added the following function (approximate; I don't know if this one will work, but you get the idea): #ifndef BSD xread(fd, buf, nbytes) int fd, nbytes; char *buf; { long here; int cnt, rcnt, acnt; extern int errno; if ((here = lseek(fd, 0L, 1)) == -1) rcnt = 1; else rcnt = nbytes; for (cnt = 0; cnt < nbytes; cnt += acnt) { if ((acnt = read(fd, buf + cnt, rcnt)) == -1) if (errno != EINTR) return -1; else { acnt = 0; if (here != -1L) (void) lseek(fd, here, 0); } else if (acnt < rcnt) return cnt + acnt; } return cnt; } #endif BSD The idea was to (1) force restarts on interrupted reads, and (2) do so in an efficient way where possible (i.e. seekable files). No checks for non- pipes are done, since I have contempt for anyone who would C-X C-I /dev/tty. Those who disagree can stick an isatty(fd) in the seekable check. I suspect that the same has to be done for writes; I've had truncated writes, and truncated file reads from before I did this. One "bug" I've noticed, which I don't think is from my code: we have an early LSRHS version of Jove on ncoast, and it displays each line from a C-X C-E as make outputs it. The new version of Jove on tdi2 waits for 1024 bytes before displaying it; I consider this unfriendly, as I prefer the proof that it's actually doing something. (There may be another bug in the fact that Jove works fine on tdi2 (a System V site) with my change as posted above, but on ncoast the new Jove always gives me: JOVE CRASH!!! (code 1) Your buffers have been saved... I traced this to random read(0, ...) calls in random places returning EOF when it wasn't expected. I don't know if this is a bug in Jove (unlikely, or it'd happen on tdi2 as well; they use the same configuration, modulo user-written memcpy()) or in System III (or Plexus Sys3; likely, given the nonsense in both Plexus Sys3 and Plexus Sys5...). I'll see about posting my actual changes. BTW, the total set of changes I made includes code to attach to /etc/avenrun's shm segment (see article X-Archive: comp.sources.misc/8708/1) to support the mode line %l parameter. -- Brandon S. Allbery, moderator of comp.sources.misc and comp.binaries.ibm.pc {{harvard,mit-eddie}!necntc,well!hoptoad,sun!cwruecmp!hal}!ncoast!allbery ARPA: necntc!ncoast!allbery@harvard.harvard.edu Fido: 157/502 MCI: BALLBERY <>