Newsgroups: comp.sources.misc From: Warren Tucker Subject: v22i078: ecu - ECU async comm package rev 3.10, Patch04b/2 Message-ID: <1991Aug30.002957.21618@sparky.IMD.Sterling.COM> X-Md4-Signature: 4679b63c96be57927cd04a72688f3315 Date: Fri, 30 Aug 1991 00:29:57 GMT Approved: kent@sparky.imd.sterling.com Submitted-by: Warren Tucker Posting-number: Volume 22, Issue 78 Archive-name: ecu/patch04b Environment: SCO, XENIX, ISC, SUNOS4.1, SYSVR4 Patch-To: ecu: Volume 21, Issue 53-89 #!/bin/sh # this is ecu/patch4b (ECU 3.10 patch 4 part 2) # do not concatenate these parts, unpack them in order with /bin/sh # file PATCH4.01 continued # if test ! -r _shar_seq_.tmp; then echo 'Please unpack part 1 first!' exit 1 fi (read Scheck if test "$Scheck" != 2; then echo Please unpack part "$Scheck" next! exit 1 else exit 0 fi ) < _shar_seq_.tmp || exit 1 if test ! -f _shar_wnt_.tmp; then echo 'x - still skipping PATCH4.01' else echo 'x - continuing file PATCH4.01' sed 's/^X//' << 'SHAR_EOF' >> 'PATCH4.01' && X! # ECU 3.13 nonansikeys X # X # This file contains mapping information to convert non-ANSI X # keyboard function keys to an internal ECU function key X*************** X*** 53,61 **** X--- 53,64 ---- X # X # Comment the SCO ODT xterm and uncomment the Metro Link xterm entry X # if you have that system. See below for xmodmap instructions. X+ # Likewise, a Sun xterm entry also appears (commented out) below. X+ # A 'sun' console entry has been added X # X #------------------------------------------------------------------------- X #+:EDITS: X+ #:08-26-1991-05:06-wht@n4hgf2-add sun console and xterm entry X #:08-10-1991-16:07-wht@n4hgf-add new Metro Link server entry X #:05-06-1991-02:31-wht@n4hgf-add tandem terminal "ansi-terminal" X #:05-05-1991-17:37-root@n4hgf-add ISC at386 tnx to dug@kd4nc X*************** X*** 237,242 **** X--- 240,318 ---- X # CUD:CUD: esc [ B X # CUL:CUL: esc [ D X # CUR:CUR: esc [ C X+ X+ ##+------------------------------------------------------------------- X+ ## Sun Sparc 1+ xterm using MIT X11R4 server (pl18) X+ ## X+ ## Place in .Xdefaults or whatever: X+ ## X+ ## XTerm*VT100*Translations: #override\ X+ ## Shift Tab: string(0x1b) string("[Z") \n \ X+ ## F27: string(0x1b) string("[H") \n \ X+ ## R13: string(0x1b) string("[F") \n \ X+ ## F29: string(0x1b) string("[I") \n \ X+ ## F31: string(0x1b) string("[E") \n \ X+ ## F35: string(0x1b) string("[G") \n \ X+ ## Insert: string(0x1b) string("[L") \n \ X+ ## X+ ## nonansikey for 'xterm' under SunOS X+ ## built by kbdtest3 1.02 Mon Aug 26 04:55:24 1991 X+ ## keyboard parity required = even X+ ##-------------------------------------------------------------------- X+ #xterm X+ # BkTab:BkTab: esc [ Z X+ # CU5:CU5: esc [ E X+ # F1:F1: esc [ 1 1 ~ X+ # F2:F2: esc [ 1 2 ~ X+ # F3:F3: esc [ 1 3 ~ X+ # F4:F4: esc [ 1 4 ~ X+ # F5:F5: esc [ 1 5 ~ X+ # F6:F6: esc [ 1 7 ~ X+ # F7:F7: esc [ 1 8 ~ X+ # F8:F8: esc [ 1 9 ~ X+ # F9:F9: esc [ 2 0 ~ X+ # F10:F10: esc [ 2 1 ~ X+ # F11:F11: esc [ 2 3 ~ X+ # F12:F12: esc [ 2 4 ~ X+ # Ins:Ins: esc [ L # Ins generates Insert X+ # Home:Home: esc [ H # Home generates F27 X+ # End:End: esc [ F # End generates R13 X+ # PgUp:PgUp: esc [ I # PgUp generates F29 X+ # PgDn:PgDn: esc [ G # PgDn generates F35 X+ # CUU:CUU: esc [ A X+ # CUD:CUD: esc [ B X+ # CUL:CUL: esc [ D X+ # CUR:CUR: esc [ C X+ X+ #+------------------------------------------------------------------- X+ # nonansikey for 'sun' (native console) under SunOS 4.1 X+ # built by kbdtest3 1.02 Mon Aug 26 16:21:57 1991 X+ # keyboard parity required = even X+ #-------------------------------------------------------------------- X+ sun X+ # BkTab:BkTab: ht # does not work X+ CU5:CU5: esc [ 2 1 8 z X+ F1:F1: esc [ 2 2 4 z X+ F2:F2: esc [ 2 2 5 z X+ F3:F3: esc [ 2 2 6 z X+ F4:F4: esc [ 2 2 7 z X+ F5:F5: esc [ 2 2 8 z X+ F6:F6: esc [ 2 2 9 z X+ F7:F7: esc [ 2 3 0 z X+ F8:F8: esc [ 2 3 1 z X+ F9:F9: esc [ 2 3 2 z X+ F10:F10: esc [ 2 3 3 z X+ F11:F11: esc [ 2 3 4 z X+ F12:F12: esc [ 2 3 5 z X+ Ins:Ins: esc [ 2 4 7 z X+ Home:Home: esc [ 2 1 4 z X+ End:End: esc [ 2 2 0 z X+ PgUp:PgUp: esc [ 2 1 6 z X+ PgDn:PgDn: esc [ 2 2 2 z X+ CUU:CUU: esc [ A X+ CUD:CUD: esc [ B X+ CUL:CUL: esc [ D X+ CUR:CUR: esc [ C X X #+------------------------------------------------------------------- X # ISC 'AT386' keyboard Xdiff -c -r /export/home/wht/src/ecu313/sea/Make.src ./sea/Make.src X*** /export/home/wht/src/ecu313/sea/Make.src Wed Aug 28 19:29:12 1991 X--- ./sea/Make.src Fri Aug 23 14:21:24 1991 X*************** X*** 69,81 **** X >> depend.tmp) ;\ X fi X X! echo '/^# DO NOT DELETE THIS LINE' >exdep.tmp X! echo '.+1,$$d' >>exdep.tmp X! echo 'r depend.tmp' >> exdep.tmp X! echo 'w' >> exdep.tmp X cp Makefile Makefile.new X! ex Makefile.new < exdep.tmp X! rm exdep.tmp depend.tmp X echo '# DEPENDENCIES MUST END AT END OF FILE' >>Makefile.new X echo '# IF YOU PUT STUFF HERE IT WILL GO AWAY'>>Makefile.new X echo '# see make depend above'>>Makefile.new X--- 69,81 ---- X >> depend.tmp) ;\ X fi X X! echo '/^# DO NOT DELETE THIS LINE' >eddep.tmp X! echo '.+1,$$d' >>eddep.tmp X! echo 'r depend.tmp' >> eddep.tmp X! echo 'w' >> eddep.tmp X cp Makefile Makefile.new X! ed Makefile.new < eddep.tmp X! rm eddep.tmp depend.tmp X echo '# DEPENDENCIES MUST END AT END OF FILE' >>Makefile.new X echo '# IF YOU PUT STUFF HERE IT WILL GO AWAY'>>Makefile.new X echo '# see make depend above'>>Makefile.new XOnly in ./sea: Makefile XOnly in ./sea: ecusea Xdiff -c -r /export/home/wht/src/ecu313/sea/ecusea.c ./sea/ecusea.c X*** /export/home/wht/src/ecu313/sea/ecusea.c Wed Aug 28 19:31:21 1991 X--- ./sea/ecusea.c Wed Aug 28 15:42:56 1991 X*************** X*** 1,4 **** X! char *revision = "3.10"; /* cannot be longer than 7 chars (blk0.sender) */ X X /* #define TABLE_CRC16 */ X #ifdef M_XENIX X--- 1,4 ---- X! char *revision = "3.14"; /* cannot be longer than 7 chars (blk0.sender) */ X X /* #define TABLE_CRC16 */ X #ifdef M_XENIX X*************** X*** 69,74 **** X--- 69,95 ---- X #include X #include X #include X+ #if defined(sun) X+ #undef ECHO X+ #undef NL0 X+ #undef NL1 X+ #undef TAB0 X+ #undef TAB1 X+ #undef TAB2 X+ #undef XTABS X+ #undef CR0 X+ #undef CR1 X+ #undef CR2 X+ #undef CR3 X+ #undef FF0 X+ #undef FF1 X+ #undef BS0 X+ #undef BS1 X+ #undef TOSTOP X+ #undef FLUSHO X+ #undef PENDIN X+ #undef NOFLSH X+ #endif X #include X #include X #include X*************** X*** 239,244 **** X--- 260,357 ---- X } /* end of crc_update */ X #endif /* crc calc selection */ X X+ /*+------------------------------------------------------------------------- X+ Nap(msec) - wrapper for nap() X+ X+ ISC and SCO UNIX nap() misbehave. This kludge doesn't return the X+ proper value (the actual time slept), but at least it does not make X+ a mockery of the manual page. It says: X+ X+ NAP(S) UNIX System V NAP(S) X+ X+ Name X+ nap - suspends execution for a short interval X+ X+ Syntax X+ long nap(period) X+ long period; X+ X+ Description X+ The current process is suspended from execution for at least X+ the number of milliseconds specified by period, or until a X+ signal is received. X+ X+ Return Value X+ On successful completion, a long integer indicating the X+ number of milliseconds actually slept is returned. If the X+ process received a signal while napping, the return value X+ will be -1, and errno will be set to EINTR. X+ X+ See Also X+ sleep(S) X+ X+ Notes X+ This function is driven by the system clock, which in most X+ cases has a granularity of tens of milliseconds. This X+ function must be linked with the linker option -lx. X+ X+ It appears nap() under UNIX 3.2.x has departed virtually entirely from X+ the manual page. I'm beginning to look rather silly in several X+ milleus since I keep telling people SCO UNIX is a viable upgrade from X+ XENIX. But process control people need some kind of timing capability X+ less than one second and we can't do it with nap or select. X+ X+ nap(msec) is supposed to nap *at least* msec milliseconds. However, X+ if msec is specified less than 1000/HZ + 1, it will not nap at all. X+ This was true for 3.2.0 and 3.2.1. X+ X+ It is supposed to return the number of milliseconds it actually X+ slept. Instead, it appears to "save up" the values and return them in X+ lots of 1000. This behavior is true for 3.2.2. X+ X+ As it is nap() is nearly useless. I believe select() suffers X+ from the same deficiency (< 1000 msec timeout becomes 1000 msec) but X+ I haven't "proven" it yet. X+ --------------------------------------------------------------------------*/ X+ long X+ Nap(msec) X+ long msec; X+ { X+ #if defined(sun) X+ struct timeval timer; X+ timer.tv_sec = 0; X+ timer.tv_usec = 1000L * msec; X+ select(0,0,0,0,&timer); X+ #else X+ #if defined(M_XENIX) || defined(WORKING_UNIX_NAP) X+ return(nap(msec)); X+ #else X+ if(msec < hzmsec) X+ msec = hzmsec; X+ if(nap(msec) < 0) X+ return(-1); X+ return(msec); X+ #endif /* defined(M_XENIX) || defined(WORKING_UNIX_NAP) */ X+ #endif /* sun */ X+ X+ } /* end of Nap */ X+ X+ /*+------------------------------------------------------------------------- X+ rdchk(fd) - for systems without it but with FIONREAD X+ --------------------------------------------------------------------------*/ X+ #if defined(sun) X+ int X+ rdchk(fd) X+ { X+ int chars_waiting; X+ X+ if(ioctl(fd,FIONREAD,&chars_waiting)) X+ return(0); X+ else X+ return(!!chars_waiting); X+ } /* end of rdchk */ X+ #endif X+ X /*+----------------------------------------------------------------------- X arg_token(parsestr,termchars) X X*************** X*** 501,507 **** X unsigned char rdchar; X long msec; X int seconds; X! long nap(long); X #else X int fdmask; X struct timeval tval; X--- 614,620 ---- X unsigned char rdchar; X long msec; X int seconds; X! long Nap(); X #else X int fdmask; X struct timeval tval; X*************** X*** 528,534 **** X msec = (tenths < 6) ? 60L : (long)tenths * 10; X while(msec) X { X! msec -= nap(20L); X if(rdchk(iofd)) X { X read(iofd,&rdchar,1); X--- 641,647 ---- X msec = (tenths < 6) ? 60L : (long)tenths * 10; X while(msec) X { X! msec -= Nap(20L); X if(rdchk(iofd)) X { X read(iofd,&rdchar,1); X*************** X*** 902,908 **** X report_last_txhdr("EOT",0); X write(iofd,&eot,1); X sent_EOT = 1; X! nap(500L); X tx_char_count++; X } X sf_blknum++; X--- 1015,1021 ---- X report_last_txhdr("EOT",0); X write(iofd,&eot,1); X sent_EOT = 1; X! Nap(500L); X tx_char_count++; X } X sf_blknum++; X*************** X*** 1363,1369 **** X { X case 0: /* receive files */ X while(receive_file() != NULL) X! nap(1000L); X ok = (rf_done == 1); X break; X X--- 1476,1482 ---- X { X case 0: /* receive files */ X while(receive_file() != NULL) X! Nap(1000L); X ok = (rf_done == 1); X break; X X*************** X*** 1373,1379 **** X { X if(!(ok = send_file(paths[ipaths]))) X break; X! nap(1000L); X ipaths++; X } X if(ok) /* no errors, send end marker */ X--- 1486,1492 ---- X { X if(!(ok = send_file(paths[ipaths]))) X break; X! Nap(1000L); X ipaths++; X } X if(ok) /* no errors, send end marker */ XOnly in ./sea: ecusea.o Xdiff -c -r /export/home/wht/src/ecu313/sea/scurses.c ./sea/scurses.c X*** /export/home/wht/src/ecu313/sea/scurses.c Wed Aug 28 19:31:24 1991 X--- ./sea/scurses.c Wed Aug 28 14:08:53 1991 X*************** X*** 48,53 **** X--- 48,54 ---- X X ------------------------------------------------------------------------*/ X /*+:EDITS:*/ X+ /*:08-28-1991-14:08-wht@n4hgf2-SVR4 cleanup by slootman@dri.nl */ X /*:07-25-1991-12:59-wht@n4hgf-ECU release 3.10 */ X /*:09-19-1990-19:36-wht@n4hgf-ecu_log_event now gets pid for log from caller */ X /*:08-14-1990-20:40-wht@n4hgf-ecu3.00-flush old edit history */ X*************** X*** 59,74 **** X #include X #include X #include X #if defined(M_SYSV) X # include X #else X # include X # include X #endif X X #include "../pc_scr.h" X- X- #include "../pc_scr.h" X #include "lint_args.h" X X long time(); X--- 60,76 ---- X #include X #include X #include X+ X #if defined(M_SYSV) X # include X #else X+ #if defined(ISC) X # include X # include X #endif X+ #endif X X #include "../pc_scr.h" X #include "lint_args.h" X X long time(); X*************** X*** 75,81 **** X extern char *tzname[]; X struct tm *localtime(); X X- X #define WIN_LINES 15 X #define WIN_COLS 60 X #define WIN_TOPY 2 X--- 77,82 ---- X*************** X*** 303,309 **** X--- 304,312 ---- X char *title; X { X register int itmp; X+ #if defined(M_UNIX) || defined(ISC) || defined(M_XENIX) X int monitor_type; X+ #endif X X if(curses_installed) X return; X*************** X*** 347,369 **** X clear_area(win,2,15,3); X sprintf(s128,"%3d",npaths); X waddstr(win,s128); X- #if defined(FORK_DEBUG) X- sprintf(s128,"ecusz pid %d",getpid()); X- #endif X } X else /* ecurz */ X { X clear_area(win,2,11,8); /* clear "of ###" */ X waddstr(win,":"); X- #if defined(FORK_DEBUG) X- sprintf(s128,"ecurz pid %d",getpid()); X- #endif X } X X- #if defined(FORK_DEBUG) X- ecu_log_event(getppid(),s128); X- #endif X- X clear_area(win,1,11,47); X report_error_count(); X clear_area(win,8,26,8); /* starting time */ X--- 350,362 ---- X*************** X*** 371,378 **** X--- 364,373 ---- X start_seconds = time((long *)0); X current_seconds = start_seconds; X X+ #if defined(M_UNIX) || defined(ISC) || defined(M_XENIX) X if(ioctl(0,CONS_GET,&monitor_type) < 0) /* not multiscreen */ X { X+ #endif X sTL = vanilla_TL; X sTR = vanilla_TR; X sBL = vanilla_BL; X*************** X*** 381,387 **** X--- 376,384 ---- X sRT = vanilla_RT; X sVR = vanilla_VR; X sHR = vanilla_HR; X+ #if defined(M_UNIX) || defined(ISC) || defined(M_XENIX) X } X+ #endif X X wrefresh(win); X X*************** X*** 484,490 **** X if(refr == 0x0C || refr == 0x012) /* ^L or ^R */ X { X write(2,"\033[2J",4); X! nap((long)60); X touchwin(stdscr); X wrefresh(stdscr); X touchwin(win); X--- 481,487 ---- X if(refr == 0x0C || refr == 0x012) /* ^L or ^R */ X { X write(2,"\033[2J",4); X! Nap((long)60); X touchwin(stdscr); X wrefresh(stdscr); X touchwin(win); XOnly in ./sea: scurses.o Xdiff -c -r /export/home/wht/src/ecu313/z/Make.src ./z/Make.src X*** /export/home/wht/src/ecu313/z/Make.src Wed Aug 28 19:34:02 1991 X--- ./z/Make.src Fri Aug 23 14:21:25 1991 X*************** X*** 101,113 **** X >> depend.tmp) ;\ X fi X X! echo '/^# DO NOT DELETE THIS LINE' >exdep.tmp X! echo '.+1,$$d' >>exdep.tmp X! echo 'r depend.tmp' >> exdep.tmp X! echo 'w' >> exdep.tmp X cp Makefile Makefile.new X! ex Makefile.new < exdep.tmp X! rm exdep.tmp depend.tmp X echo '# DEPENDENCIES MUST END AT END OF FILE' >>Makefile.new X echo '# IF YOU PUT STUFF HERE IT WILL GO AWAY'>>Makefile.new X echo '# see make depend above'>>Makefile.new X--- 101,113 ---- X >> depend.tmp) ;\ X fi X X! echo '/^# DO NOT DELETE THIS LINE' >eddep.tmp X! echo '.+1,$$d' >>eddep.tmp X! echo 'r depend.tmp' >> eddep.tmp X! echo 'w' >> eddep.tmp X cp Makefile Makefile.new X! ed Makefile.new < eddep.tmp X! rm eddep.tmp depend.tmp X echo '# DEPENDENCIES MUST END AT END OF FILE' >>Makefile.new X echo '# IF YOU PUT STUFF HERE IT WILL GO AWAY'>>Makefile.new X echo '# see make depend above'>>Makefile.new XOnly in ./z: Makefile Xdiff -c -r /export/home/wht/src/ecu313/z/baudtest.c ./z/baudtest.c X*** /export/home/wht/src/ecu313/z/baudtest.c Wed Aug 28 19:31:06 1991 X--- ./z/baudtest.c Wed Aug 28 14:08:53 1991 X*************** X*** 1,12 **** X- X /*+------------------------------------------------------------------------- X baudtest.c X wht@n4hgf.Mt-Park.GA.US X X Alas, on some systems, curses insists on sgtty.h inclusion X! which does not get aslong with termio.h AT ALL X --------------------------------------------------------------------------*/ X /*+:EDITS:*/ X /*:07-25-1991-12:59-wht@n4hgf-ECU release 3.10 */ X /*:12-04-1990-05:36-wht-creation */ X X--- 1,13 ---- X /*+------------------------------------------------------------------------- X baudtest.c X wht@n4hgf.Mt-Park.GA.US X X Alas, on some systems, curses insists on sgtty.h inclusion X! which does not get along with termio.h AT ALL X --------------------------------------------------------------------------*/ X /*+:EDITS:*/ X+ /*:08-28-1991-14:08-wht@n4hgf2-SVR4 cleanup by slootman@dri.nl */ X+ /*:08-23-1991-18:33-wht@n4hgf2-disable force no curses for tty vs. line speed */ X /*:07-25-1991-12:59-wht@n4hgf-ECU release 3.10 */ X /*:12-04-1990-05:36-wht-creation */ X X*************** X*** 28,33 **** X--- 29,35 ---- X verbose than if tty not char special X X --------------------------------------------------------------------------*/ X+ #ifdef TTY_VS_LINE_SPEED_NO_CURSES X void X test_tty_and_line_baud() X { X*************** X*** 37,43 **** X memset((char *)&tty_termio,0,sizeof(struct termio)); X memset((char *)&line_termio,0,sizeof(struct termio)); X if(ioctl(0,TCGETA,&tty_termio) || ioctl(iofd,TCGETA,&line_termio) || X! ((tty_termio.c_cflag & CBAUD) < ((line_termio.c_cflag & CBAUD)))) X { X fprintf(stderr,"%s %o %o\r\n",numeric_revision, X (tty_termio.c_cflag & CBAUD), (line_termio.c_cflag & CBAUD)); X--- 39,45 ---- X memset((char *)&tty_termio,0,sizeof(struct termio)); X memset((char *)&line_termio,0,sizeof(struct termio)); X if(ioctl(0,TCGETA,&tty_termio) || ioctl(iofd,TCGETA,&line_termio) || X! ((tty_termio.c_cflag & CBAUD) < (unsigned)((line_termio.c_cflag & CBAUD)))) X { X fprintf(stderr,"%s %o %o\r\n",numeric_revision, X (tty_termio.c_cflag & CBAUD), (line_termio.c_cflag & CBAUD)); X*************** X*** 47,52 **** X--- 49,55 ---- X } X X } /* end of test_tty_and_line_baud */ X+ #endif X X /* vi: set tabstop=4 shiftwidth=4: */ X /* end of baudtest.c */ XOnly in ./z: baudtest.o XOnly in ./z: ecurz Xdiff -c -r /export/home/wht/src/ecu313/z/ecurz.c ./z/ecurz.c X*** /export/home/wht/src/ecu313/z/ecurz.c Wed Aug 28 19:31:08 1991 X--- ./z/ecurz.c Wed Aug 28 15:42:29 1991 X*************** X*** 1,4 **** X! char *numeric_revision = "ecurz 3.13"; X /*+------------------------------------------------------------------------- X ecurz.c - X/Y/ZMODEM receive program X Derived from public domain source by Chuck Forsberg, Omen Technologies X--- 1,4 ---- X! char *numeric_revision = "ecurz 3.14"; X /*+------------------------------------------------------------------------- X ecurz.c - X/Y/ZMODEM receive program X Derived from public domain source by Chuck Forsberg, Omen Technologies X*************** X*** 57,62 **** X--- 57,63 ---- X X --------------------------------------------------------------------------*/ X /*+:EDITS:*/ X+ /*:08-28-1991-14:08-wht@n4hgf2-SVR4 cleanup by slootman@dri.nl */ X /*:07-25-1991-12:59-wht@n4hgf-ECU release 3.10 */ X /*:04-30-1991-18:33-wht@n4hgf-gcc version coredumping on putc(); use fputc() */ X /*:03-27-1991-21:21-wht@n4hgf-dont bump error count on send ZRPOS */ X*************** X*** 95,105 **** X extern int Rxtimeout; /* Tenths of seconds to wait for something */ X extern char s128[128]; X X! /* Max value for VMIN_COUNT is 255. A larger value reduces system X! overhead but may evoke kernel bugs. 133 corresponds to an XMODEM/CRC X! sector */ X #if !defined(VMIN_COUNT) X! #define VMIN_COUNT 133 X #endif X unsigned char vmin_count = VMIN_COUNT; X int Readnum = VMIN_COUNT; /* num bytes to ask for in read() from modem */ X--- 96,132 ---- X extern int Rxtimeout; /* Tenths of seconds to wait for something */ X extern char s128[128]; X X! /* X! * Max value for VMIN_COUNT is 255. A larger value reduces system X! * overhead but may evoke kernel bugs. 133 corresponds to an XMODEM/CRC X! * sector. X! X! Paul Slootman said, though: X! :PS: Something somewhere in the SVR4 kernel is a signed char, which causes X! :PS: VMIN values of more than 127 to return *immediately* without ever X! :PS: reading... X! :PS: X! :PS: I had troubles running the regular rz, which was where I saw X! :PS: the bug the first time. I've also heard of this from someone X! :PS: else, running something else than the ICL SPARC port for SVR4: X! :PS: X! :PS: Date: Sat, 3 Aug 91 11:41:16 EDT X! :PS: From: tompkins@cat.syr.edu (Terry Tompkins) X! :PS: Subject: Re: Zmodem X! :PS: X! :PS: Thanks for the info. I just returned from vacation - sorry for the delay. X! :PS: We are running AT&T 5.4 UNIX on an Osicom 25mhz 386. If you hear of a X! :PS: fix for the OS, let me know - I feel a little apprehensive about a kernel X! :PS: bug of this nature. (The machine is a network server that we are using X! :PS: for all kinds of things). X! */ X! X #if !defined(VMIN_COUNT) X! # ifdef SVR4 X! # define VMIN_COUNT 127 X! # else X! # define VMIN_COUNT 133 X! # endif X #endif X unsigned char vmin_count = VMIN_COUNT; X int Readnum = VMIN_COUNT; /* num bytes to ask for in read() from modem */ XOnly in ./z: ecurz.o XOnly in ./z: ecusz Xdiff -c -r /export/home/wht/src/ecu313/z/ecusz.c ./z/ecusz.c X*** /export/home/wht/src/ecu313/z/ecusz.c Wed Aug 28 19:31:11 1991 X--- ./z/ecusz.c Wed Aug 28 15:42:40 1991 X*************** X*** 1,4 **** X! char *numeric_revision = "ecusz 3.13"; X #define BUFFERED_WRITE X /*+------------------------------------------------------------------------- X ecusz.c - X/Y/ZMODEM send program X--- 1,4 ---- X! char *numeric_revision = "ecusz 3.14"; X #define BUFFERED_WRITE X /*+------------------------------------------------------------------------- X ecusz.c - X/Y/ZMODEM send program X*************** X*** 66,71 **** X--- 66,72 ---- X X --------------------------------------------------------------------------*/ X /*+:EDITS:*/ X+ /*:08-28-1991-14:08-wht@n4hgf2-SVR4 cleanup by slootman@dri.nl */ X /*:07-25-1991-12:59-wht@n4hgf-ECU release 3.10 */ X /*:02-03-1991-17:27-wht@n4hgf-version number change - see zcurses.c */ X /*:12-18-1990-21:26-wht@n4hgf-better output control */ X*************** X*** 127,138 **** X #if defined(READCHECK) X char Myattn[] = { 0 }; X #else X- #if defined(M_SYS5) X char Myattn[] = { 03,0336,0 }; X- #else X- char Myattn[] = { 0 }; X #endif X- #endif X X FILE *in; X X--- 128,135 ---- X*************** X*** 340,349 **** X onintr() X { X signal(SIGINT,SIG_IGN); X- #if defined(M_SYS5) X report_rx_ind(0); X report_tx_ind(0); X- #endif X longjmp(intrjmp,-1); X } X X--- 337,344 ---- X*************** X*** 472,480 **** X--- 467,478 ---- X X flushline() X { X+ struct termio tio; X #ifdef BUFFERED_WRITE X fflush(iofp); X #endif X+ ioctl(iofd,TCGETA,(char *)&tio); X+ ioctl(iofd,TCSETAW,(char *)&tio); X } X X main(argc,argv) X*************** X*** 704,710 **** X write(iofd,"rz\r",3); X else /* wht -- why not? */ X write(iofd,"rb\r",3); /* wht */ X! nap(2000L); X report_str("",-1); X if(!Nozmodem) X { X--- 702,708 ---- X write(iofd,"rz\r",3); X else /* wht -- why not? */ X write(iofd,"rb\r",3); /* wht */ X! Nap(2000L); X report_str("",-1); X if(!Nozmodem) X { X*************** X*** 885,891 **** X else if(*p == '.') X *(q=p) = '/'; X } X! if(q && strlen(++q) > 8) X { /* If name>8 chars */ X q += 8; /* make it .ext */ X strcpy(name2,q); /* save excess of name */ X--- 883,889 ---- X else if(*p == '.') X *(q=p) = '/'; X } X! if(q && strlen(++q) > (unsigned)8) X { /* If name>8 chars */ X q += 8; /* make it .ext */ X strcpy(name2,q); /* save excess of name */ X*************** X*** 1230,1239 **** X SIGTYPE X SIGALRM_handler() X { X- #if defined(M_SYS5) X report_rx_ind(0); X report_tx_ind(0); X- #endif X longjmp(tohere,-1); X } /* end of SIGALRM_handler */ X X--- 1228,1235 ---- X*************** X*** 1296,1306 **** X --------------------------------------------------------------------------*/ X purgeline() X { X- #if defined(M_SYS5) X ioctl(iofd,TCFLSH,0); X- #else X- lseek(iofd,0L,2); X- #endif X } /* end of purgeline */ X X X--- 1292,1298 ---- X*************** X*** 1392,1404 **** X mode(2); /* Set cbreak,XON/XOFF,etc. */ X #endif X #if !defined(READCHECK) X- #if !defined(M_SYS5) X /* Use 1024 byte frames if no sample/interrupt */ X if(Rxbuflen < 32 || Rxbuflen > 1024) X { X Rxbuflen = 1024; X } X- #endif X #endif X /* Override to force shorter frame length */ X if(Rxbuflen && (Rxbuflen>Tframlen) && (Tframlen>=32)) X--- 1384,1394 ---- XOnly in ./z: ecusz.o Xdiff -c -r /export/home/wht/src/ecu313/z/lint_args.h ./z/lint_args.h X*** /export/home/wht/src/ecu313/z/lint_args.h Wed Aug 28 19:31:12 1991 X--- ./z/lint_args.h Fri Aug 23 14:23:00 1991 X*************** X*** 25,31 **** X int clear_area_char(struct _win_st *,int ,int ,int ,char ); X int determine_output_mode(void ); X int report_comm_baud_rate(unsigned int ); X! int report_error_count(void ); X int report_file_byte_io(long ); X int report_file_open_length(long ); X int report_file_open_mode(unsigned short ); X--- 25,31 ---- X int clear_area_char(struct _win_st *,int ,int ,int ,char ); X int determine_output_mode(void ); X int report_comm_baud_rate(unsigned int ); X! void report_error_count(void ); X int report_file_byte_io(long ); X int report_file_open_length(long ); X int report_file_open_mode(unsigned short ); X*************** X*** 88,93 **** X--- 88,94 ---- X char *hhmmss(); X char *mode_map(); X void no_curses_newline(); X+ void report_error_count(); X void report_file_close(); X void report_file_open_tod(); X void report_file_send_open(); Xdiff -c -r /export/home/wht/src/ecu313/z/zcommon.c ./z/zcommon.c X*** /export/home/wht/src/ecu313/z/zcommon.c Wed Aug 28 19:31:13 1991 X--- ./z/zcommon.c Wed Aug 28 19:51:26 1991 X*************** X*** 16,21 **** X--- 16,22 ---- X X --------------------------------------------------------------------------*/ X /*+:EDITS:*/ X+ /*:08-21-1991-06:23-wht@n4hgf-sun porting */ X /*:07-25-1991-12:59-wht@n4hgf-ECU release 3.10 */ X /*:08-14-1990-20:40-wht@n4hgf-ecu3.00-flush old edit history */ X X*************** X*** 26,31 **** X--- 27,36 ---- X #include X #include "zmodem.h" X X+ #if defined(sun) || defined(SVR4) X+ # include X+ #endif X+ X extern unsigned char vmin_count; X extern int Zmodem; X extern unsigned Baudrate; X*************** X*** 248,254 **** X report_mode(new_mode); X switch(new_mode) X { X- #if defined(M_SYSV) X case 2: /* Un-raw mode used by sz,sb when -g detected */ X if(!did0) X (void) ioctl(iofd,TCGETA,&oldtty); X--- 253,258 ---- X*************** X*** 323,403 **** X Baudrate = getspeed(tty.c_cflag & CBAUD); X report_comm_baud_rate(Baudrate); X return(OK); X- #endif X- #if defined(pyr) X- /* X- * NOTE: this should transmit all 8 bits and at the same time X- * respond to XOFF/XON flow control. If no FIONREAD or other X- * READCHECK alternative,also must respond to INTRRUPT char X- * This doesn't work with BSD4. It should work with LLITOUT, X- * but LLITOUT was broken on the machine I tried it on. X- */ X- case 2: /* Un-raw mode used by sz,sb when -g detected */ X- if(!did0) X- { X- ioctl(iofd,TIOCEXCL,0); X- ioctl(iofd,TIOCGETP,&oldtty); X- ioctl(iofd,TIOCGETC,&oldtch); X- #if defined(LLITOUT) X- ioctl(TIOCLGET,&Locmode); /* Get "local mode" */ X- #endif X- } X- tty = oldtty; X- tch = oldtch; X- #if defined(READCHECK) X- tch.t_intrc = Zmodem ? -1:030; /* Interrupt char */ X- #else X- tch.t_intrc = Zmodem ? 03:030; /* Interrupt char */ X- #endif X- tty.sg_flags |= (ODDP|EVENP|CBREAK); X- tty.sg_flags &= ~(ALLDELAY|CRMOD|ECHO|LCASE); X- ioctl(iofd,TIOCSETP,&tty); X- ioctl(iofd,TIOCSETC,&tch); X- #if defined(LLITOUT) X- ioctl(TIOCLBIS,&Locbit); X- #endif X- /* un-raw doesn't work w/o lit out *//*wht code was 99 */ X- cancel_transaction(0); X- did0 = TRUE; X- return(OK); X- case 1: X- case 3: X- if(!did0) X- { X- ioctl(iofd,TIOCEXCL,0); X- ioctl(iofd,TIOCGETP,&oldtty); X- ioctl(iofd,TIOCGETC,&oldtch); X- #if defined(LLITOUT) X- ioctl(TIOCLGET,&Locmode); /* Get "local mode" */ X- #endif X- } X- tty = oldtty; X- tty.sg_flags |= RAW; X- tty.sg_flags &= ~ECHO; X- ioctl(iofd,TIOCSETP,&tty); X- did0 = TRUE; X- Baudrate = getspeed(tty.sg_ospeed); X- report_comm_baud_rate(Baudrate); X- return(OK); X- #endif X case 0: X if(!did0) X return(ERROR); X- #if defined(M_SYS5) X (void) ioctl(iofd,TCSBRK,1); /* Wait for output to drain */ X (void) ioctl(iofd,TCFLSH,1); /* Flush input queue */ X (void) ioctl(iofd,TCSETAW,&oldtty); /* Restore modes */ X (void) ioctl(iofd,TCXONC,1); /* Restart output */ X- #endif X- #if defined(pyr) X- ioctl(iofd,TIOCSETP,&oldtty); X- ioctl(iofd,TIOCSETC,&oldtch); X- ioctl(iofd,TIOCNXCL,0); X- #if defined(LLITOUT) X- ioctl(TIOCLSET,&Locmode); /* Restore "local mode" */ X- #endif X- #endif X- X return(OK); X default: X return(ERROR); X--- 327,339 ---- X*************** X*** 409,423 **** X --------------------------------------------------------------------------*/ X sendbrk() X { X- #if defined(pyr) X- sleep(1); X- ioctl(iofd,TIOCSBRK,0); X- sleep(1); X- ioctl(iofd,TIOCCBRK,0); X- #endif X- #if defined(M_SYS5) X ioctl(iofd,TCSBRK,0); X- #endif X } /* end of sendbrk */ X X /*+------------------------------------------------------------------------- X--- 345,351 ---- X*************** X*** 428,441 **** X char *currdir; X int currdir_max; X { X- #if defined(pyr) X- getwd(currdir); X- #endif X- X- #if defined(M_SYS5) X getcwd(currdir,currdir_max); X- #endif X- X } /* end of get_curr_dir */ X X /*+------------------------------------------------------------------------- X--- 356,362 ---- X*************** X*** 492,496 **** X--- 413,494 ---- X X } /* end of get_home_dir */ X X+ /*+------------------------------------------------------------------------- X+ Nap(msec) - wrapper for nap() X+ X+ ISC and SCO UNIX nap() misbehave. This kludge doesn't return the X+ proper value (the actual time slept), but at least it does not make X+ a mockery of the manual page. It says: X+ X+ NAP(S) UNIX System V NAP(S) X+ X+ Name X+ nap - suspends execution for a short interval X+ X+ Syntax X+ long nap(period) X+ long period; X+ X+ Description X+ The current process is suspended from execution for at least X+ the number of milliseconds specified by period, or until a X+ signal is received. X+ X+ Return Value X+ On successful completion, a long integer indicating the X+ number of milliseconds actually slept is returned. If the X+ process received a signal while napping, the return value X+ will be -1, and errno will be set to EINTR. X+ X+ See Also X+ sleep(S) X+ X+ Notes X+ This function is driven by the system clock, which in most X+ cases has a granularity of tens of milliseconds. This X+ function must be linked with the linker option -lx. X+ X+ It appears nap() under UNIX 3.2.x has departed virtually entirely from X+ the manual page. I'm beginning to look rather silly in several X+ milleus since I keep telling people SCO UNIX is a viable upgrade from X+ XENIX. But process control people need some kind of timing capability X+ less than one second and we can't do it with nap or select. X+ X+ nap(msec) is supposed to nap *at least* msec milliseconds. However, X+ if msec is specified less than 1000/HZ + 1, it will not nap at all. X+ This was true for 3.2.0 and 3.2.1. X+ X+ It is supposed to return the number of milliseconds it actually X+ slept. Instead, it appears to "save up" the values and return them in X+ lots of 1000. This behavior is true for 3.2.2. X+ X+ As it is nap() is nearly useless. I believe select() suffers X+ from the same deficiency (< 1000 msec timeout becomes 1000 msec) but X+ I haven't "proven" it yet. X+ --------------------------------------------------------------------------*/ X+ long X+ Nap(msec) X+ long msec; X+ { X+ #if defined(sun) || defined(SVR4) X+ struct timeval timer; X+ timer.tv_sec = 0; X+ timer.tv_usec = 1000L * msec; X+ select(0,0,0,0,&timer); X+ #else X+ #if defined(M_XENIX) || defined(WORKING_UNIX_NAP) X+ return(nap(msec)); X+ #else X+ #ifdef NEED_SHORT_INTERVALS /* borrow hzmsec setup from ecu.c if need to >*/ X+ if(msec < hzmsec) X+ msec = hzmsec; X+ #endif X+ if(nap(msec) < 0) X+ return(-1); X+ return(msec); X+ #endif /* defined(M_XENIX) || defined(WORKING_UNIX_NAP) */ X+ #endif /* sun */ X+ X+ } /* end of Nap */ X /* end of zcommon.c */ X /* vi: set tabstop=4 shiftwidth=4: */ XOnly in ./z: zcommon.o Xdiff -c -r /export/home/wht/src/ecu313/z/zcurses.c ./z/zcurses.c X*** /export/home/wht/src/ecu313/z/zcurses.c Wed Aug 28 19:31:16 1991 X--- ./z/zcurses.c Wed Aug 28 14:08:54 1991 X*************** X*** 60,65 **** X--- 60,68 ---- X X ------------------------------------------------------------------------*/ X /*+:EDITS:*/ X+ /*:08-28-1991-14:08-wht@n4hgf2-SVR4 cleanup by slootman@dri.nl */ X+ /*:08-23-1991-18:33-wht@n4hgf2-disable force no curses for tty vs. line speed */ X+ /*:08-21-1991-06:23-wht@n4hgf-sun porting */ X /*:07-25-1991-12:59-wht@n4hgf-ECU release 3.10 */ X /*:06-15-1991-05:47-root@n4hgf-report per-file xfer rate */ X /*:05-25-1991-14:51-wht@n4hgf-FAS/i display */ X*************** X*** 79,90 **** X--- 82,97 ---- X #include X #include X #include X+ X #if defined(M_SYSV) X # include X #else X+ #if defined(ISC) X # include X # include X #endif X+ #endif X+ X #if defined(FASI) X # include X #endif /* FASI */ X*************** X*** 270,281 **** X case S_IFBLK: *rtn = 'b'; break; /* block special */ X case S_IFREG: *rtn = '-'; break; /* regular */ X X! #if defined(pyr) | defined(BSD4) X case S_IFLNK: *rtn = 'l'; break; /* symbolic link */ X case S_IFSOCK: *rtn = 's'; break; /* socket */ X #endif X X! #if defined(M_SYS5) X case S_IFNAM: /* name space entry */ X if(mode & S_INSEM) /* semaphore */ X { X--- 277,288 ---- X case S_IFBLK: *rtn = 'b'; break; /* block special */ X case S_IFREG: *rtn = '-'; break; /* regular */ X X! #if defined(BSD) X case S_IFLNK: *rtn = 'l'; break; /* symbolic link */ X case S_IFSOCK: *rtn = 's'; break; /* socket */ X #endif X X! #if defined(SYSV) X case S_IFNAM: /* name space entry */ X if(mode & S_INSEM) /* semaphore */ X { X*************** X*** 522,528 **** X--- 529,537 ---- X int X determine_output_mode() X { X+ #if defined(M_UNIX) || defined(ISC) || defined(M_XENIX) X int monitor_type; X+ #endif X struct stat dn; X struct stat tty_stat; X #ifdef NO_PTY_CURSES X*************** X*** 537,544 **** X--- 546,555 ---- X return(1); X } X X+ #if defined(M_UNIX) || defined(ISC) || defined(M_XENIX) X if(ioctl(0,CONS_GET,&monitor_type) < 0) /* not multiscreen */ X { X+ #endif X sTL = vanilla_TL; X sTR = vanilla_TR; X sBL = vanilla_BL; X*************** X*** 585,592 **** X--- 596,607 ---- X * of the attached line, use no curses, but do be a bit X * more verbose than if tty not char special X */ X+ #ifdef TTY_VS_LINE_SPEED_NO_CURSES X test_tty_and_line_baud(); X+ #endif X+ #if defined(M_UNIX) || defined(ISC) || defined(M_XENIX) X } X+ #endif X X return(no_curses); X X*************** X*** 1077,1083 **** X long rxpos; X { X char tmp[16]; X- #if defined(M_SYS5) X char refr; X X if(no_curses) X--- 1092,1097 ---- X*************** X*** 1091,1097 **** X if(refr == 0x0C || refr == 0x012) /* ^L or ^R */ X { X write(2,"\033[2J",4); X! nap((long)60); X touchwin(stdscr); X wrefresh(stdscr); X touchwin(win); X--- 1105,1111 ---- X if(refr == 0x0C || refr == 0x012) /* ^L or ^R */ X { X write(2,"\033[2J",4); X! Nap((long)60); X touchwin(stdscr); X wrefresh(stdscr); X touchwin(win); X*************** X*** 1098,1104 **** X wrefresh(win); X } X } X- #endif X X if((rxpos > 99999999L) || (rxpos < 0L)) X return; X--- 1112,1117 ---- X*************** X*** 1134,1139 **** X--- 1147,1153 ---- X total: row 10 col 33 len 4 X skipped: row 10 col 53 len 3 X --------------------------------------------------------------------------*/ X+ void X report_error_count() X { X char tmp[16]; XOnly in ./z: zcurses.o Xdiff -c -r /export/home/wht/src/ecu313/z/zmodem.h ./z/zmodem.h X*** /export/home/wht/src/ecu313/z/zmodem.h Wed Aug 28 19:31:19 1991 X--- ./z/zmodem.h Wed Aug 28 14:08:55 1991 X*************** X*** 2,7 **** X--- 2,9 ---- X zmodem.h -- common include filefor ecurz/ecusz X --------------------------------------------------------------------------*/ X /*+:EDITS:*/ X+ /*:08-28-1991-14:08-wht@n4hgf2-SVR4 cleanup by slootman@dri.nl */ X+ /*:08-21-1991-06:23-wht@n4hgf-sun porting */ X /*:07-25-1991-12:59-wht@n4hgf-ECU release 3.10 */ X /*:08-14-1990-20:41-wht@n4hgf-ecu3.00-flush old edit history */ X X*************** X*** 25,30 **** X--- 27,53 ---- X #include X #include X #include X+ #if defined(sun) X+ #undef ECHO X+ #undef NL0 X+ #undef NL1 X+ #undef TAB0 X+ #undef TAB1 X+ #undef TAB2 X+ #undef XTABS X+ #undef CR0 X+ #undef CR1 X+ #undef CR2 X+ #undef CR3 X+ #undef FF0 X+ #undef FF1 X+ #undef BS0 X+ #undef BS1 X+ #undef TOSTOP X+ #undef FLUSHO X+ #undef PENDIN X+ #undef NOFLSH X+ #endif X #include X #include X #define MODE2OK X*************** X*** 74,80 **** X * Omen Technology. X */ X X! #define updcrc(cp, crc) ( crctab[((crc >> 8) & 255)] ^ (crc << 8) ^ (cp)) X #define UPDC32(b, c) (cr3tab[((int)c ^ b) & 0xff] ^ ((c >> 8) & 0x00FFFFFF)) X X X--- 97,103 ---- X * Omen Technology. X */ X X! #define updcrc(cp, crc) ( crctab[(((unsigned)crc >> 8) & 255)] ^ (crc << 8) ^ (cp)) X #define UPDC32(b, c) (cr3tab[((int)c ^ b) & 0xff] ^ ((c >> 8) & 0x00FFFFFF)) X X XOnly in ./z: zmodem.o SHAR_EOF echo 'File PATCH4.01 is complete' && chmod 0664 PATCH4.01 || echo 'restore of PATCH4.01 failed' Wc_c="`wc -c < 'PATCH4.01'`" test 83457 -eq "$Wc_c" || echo 'PATCH4.01: original size 83457, current size' "$Wc_c" rm -f _shar_wnt_.tmp fi rm -f _shar_seq_.tmp echo You have unpacked the last part exit 0 exit 0 # Just in case...