Subject: 2.11BSD gets RTS/CTS flow control (#369 - 1 of 3) Index: sys/tty.c,dhv.c,bin/stty.c,... 2.11BSD Description: RTS/CTS flow control, used to insure reliable communications on serial lines, is missing from 2.11BSD Repeat-By: Using C-Kermit (version 5A-188 was included in 2.11) establish a connection via a modem and a line speed of 9600 or greater. There are two things to watch for: 1) If large packets are enabled (greater than ~128 bytes) and a file transfer is started there will be many truncated or "crunched" packets. 2) During the interactive mode large sections of the output will be missing as data overruns occur. Using 'tip' (or 'cu') there will be much lost data. It should come as no surprise that XON/XOFF is not very effective over modem lines at speeds of 9600 or greater (C-kermit requires more flow control than tip due to kermit's higher cpu utilization). In both cases the data loss is made much worse if there is other activity on the system (especially in the case of an 11/73 which is not as fast as the 11/44 or 11/93). If background disk activity is started (via 'cron', 'sendmail', etc) the data loss on the serial ports will be even worse than usual. Fix: One approach to fixing the lack of hardware flow control would have been to port the 4.4BSD 'termios' tty subsystem. This was deemed, at the present time, to be unfeasible due to data structure growth ("bloat"?). The "struct tty" grew by a factor of between 2 and 3 (from 72 bytes to somewhere around 200) for one thing. An alternate approach of adding RTS/CTS to the existing 4.3BSD based tty subsystem was adopted. This was also seen as a good chance to simplify the tty system in the kernel. After consulting with a group of people running 2.11 a consensus was reached that the "special character delay" feature ("BSDELAY VTDELAY FFDELAY TBDELAY") was not needed any longer (indeed that feature is not present in 4.4BSD based systems). By trading the old unused "delay" logic for RTS/CTS flow control the overall size of the kernel actually SHRANK. In my case the kernel code size dropped by about 400 bytes! NOTE: Only the dhv(4) driver has been modified to take advantage of the RTS/CTS capability because that's what I have to test with. The dhu(4) driver is very similar (because the dhv driver was derived from the dhu one) and should be fairly straightforward to change. The dh(4) drive will be done in the (near) future as I have access to an 11/44 with a couple DH11 clones (Able boards). One change of note in the kernel is that the TTYHOG, TTYBLOCK and TTYUNBLOCK (the latter two are new with this update) parameters are now patchable global variables rather than compile time '#define's. The 'HOG' parameter is the maximum number of characters that can be outstanding in the tty queue for a serial line, the 'BLOCK' parameter is the number of characters in the queue at which RTS is dropped, and 'UNBLOCK' is the number of characters in the queue at which RTS is raised. See the comments in /sys/sys/tty.c for more information. NOTE: The numbers can not be raised arbitrarily high. There is a fixed maximum size of 8kb for clist data available for the entire kernel (all serial devices, printers, etc). The global variables affect ALL devices that use clist blocks, not just a particular line. How to make the new capability useful without having to modify every program that deals with serial ports was an interesting problem. The solution was to use bit 6 in the minor device number. Bit 7 (0200) of the minor device being on says the line is "hard-wired" or "software carrier" (assume carrier detect is always on) . Bit 6 now means "use RTS/CTS flow control". Thus, using "ttyS0" (the first DHV-11 channel) as an example: mknod ttyS0 c 24 0 mknod ttyS0 c 24 64 mknod ttyS0 c 24 128 mknod ttyS0 c 24 192 The first device node has no rts/cts flow control (unless enabled via a ioctl(3) call) and waits for carrier detect to be asserted before an open(2) completes. This is the traditional "incoming modem" setup. The second device is still an "incoming modem" device but RTS/CTS flow control will be used automatically (unless turned off by an ioctl(3) later on). The third device is a direct connection - carrier is assumed to be always present an no RTS/CTS flow control will be used (unless enabled by ioctl(3)). The fourth device is a direct connection - carrier is assumed present and RTS/CTS flow control will be used (unless turned off by ioctl(3)). The RTS/CTS bit may be turned off and on by the TIOCLBIS, TIOCLBIC, and TIOCLSET ioctl(3) calls in program which are "rts/cts" aware. The stty(1) program is a good example of such a program (and a new improved version is included in this update kit). NOTE: Using bits 6 and 7 of the minor device number reduces the number of DHV11 board that may be present in a system from 16 to 8. Since most systems only have two or three slots available this new lower limit is not likely to be a problem. The number of DH-11 (16 channel) boards has been reduced from 8 to 4. Since each tty structure is ~72 bytes it is unlikely that any kernel has the necessary data space available to support 64 channels of any serial device. Surprisingly few applications needed modifications to deal with the removal of the "*DELAY" flag bits from the tty system. Many of those programs were games and the changes were trivial (simply remove references to the {VT,BS,TB,FF}DELAY symbols). The only substantial program that will need to be recompiled is 'tcsh'. As a concession to backwards compatibility the symbols (*DELAY, L001000, etc) which are no longer present in /sys/h/ioctl.h can be found in ioctl_compat.h. ALL of the symbols are defined to be 0x0 since they have no meaning (or effect) in the kernel. The stty(1) program has been substantially augmented. It now can set/clear the RTS/CTS bit as well as display the current modem signal status. The man page has been updated to reflect these changes. A new feature in 'stty' and the tty system is the ability to disable special characters (^C, ^Z, etc) even in "cooked" mode. Using 'stty' this is done with the special word "undef": stty intr undef will disable the interrupt character (normally ^C). Also added to stty(1) is the "-a" and "-e" options so that you can simply type "stty -a" or "stty -e" instead of "stty all" and "stty everything" respectively. A VERY useful addition to stty(1) is the "-f device" option. This allows specifying a device name directly on the command line rather than having to redirect 'stdout'. Another benefit of the "-f" option is that it uses a nonblocking open(2) and can modify ports on which carrier is not present. Serial ports which wedge due to the output queue not draining will benefit from the new "flushout" option in stty(1): stty -f /dev/ttyS0 flushout will cause the output queue to be flushed and allow processes waiting for the line close to exit. This is #369 and is part 1 of 3. Make sure you have #370 and 371 (parts 2 and 3) before proceeding with the installation of the update. Part 1 (this part) contains 1. Introduction (what you've been reading until this point ;-)) 2. Instructions on how to unpack and apply the changes. 3. A shar file of new files being added to the system. 4. A shell script to remove files no longer needed and to relocate other files (stty gets a directory of its own). 5. The first of 3 rather large patches. Part 2 contains the second of the three patches. Part 3 contains the last part of the patches. INSTRUCTIONS ============ Gather all three parts (369, 370 and 371). Make copies of the files and cut where indicated in each of them. The names /tmp/369, /tmp/370 and /tmp/371 are used in the directions below. Let the fun begin! cd /tmp umask 22 sh 369 sh sh.369 sh shar.369 patch -p0 < diffs.369 patch -p0 < 370 patch -p0 < 371 Then a small number of applications need to be compiled and installed. It is safe to do this before recompiling the kernel because none of the bits that have been made available in the tty system have been reused for anything. Thus, programs that set/clear the *DELAY bits will continue to see the expected values set and returned. cd /usr/src/bin/stty make make install make clean cd /usr/src/libexec/getty make make install make clean cd /usr/src/bin/tcsh make make install make clean cd /usr/src/games/hack make make install cd /usr/src/games/snake make make install make clean cd /usr/src/local/zmodem make make install make clean cd /usr/src/ucb/tset make make install make clean cd /usr/src/ucb make vmstat install -s -m 2755 -g kmem vmstat /usr/ucb/vmstat cd /usr/src/usr.bin make tabs install -s -m 755 tabs /usr/bin/tabs cd /usr/src/man/man4 /usr/man/manroff tty.4 > /usr/man/cat4/tty.0 cd /usr/src/man/man5 /usr/man/manroff gettytab.5 > /usr/man/cat5/gettytab.0 Not very many programs considering the size of the changes to the kernel and tty system. Next the kernel needs to be recompiled, installed and the system rebooted. cd /sys/YOUR_KERNEL make clean make mv /unix /ounix mv /netnix /onetnix mv unix netnix / chmod 744 /unix /netnix NOTE: If you are running a NON networking kernel omit the references to 'netnix' reboot NOTE: You may want to use 'fastboot' instead if you want to bypass the filesystem checks. That's all. You're done. Enjoy higher speed file transfers, no crunched packets or missing data during kermit sessions even if a kernel recompile is taking place in the background. Other device drivers will be updated as hardware becomes available or folks with the hardware have an increased supply of copious free time. The DHV-11 driver is the only one at the present time that is fully aware of the changes to the tty subsystem. Other drivers will not perform hardware flowcontrol because they do not support the necessary TIOCM{BIC,BIS,GET,SET} calls to manipulate modem signals. The DH11 driver is an example of one which will NOT work. The DZ11 driver on the other hand is a driver which MIGHT work since it has the necessary ioctl() support present. Other drivers will be updated as hardware and systems become available (copious free time is the other obvious requirement ;)). As always this and previous updates to 2.11BSD are available via anonymous FTP to either FTP.IIPO.GTEGSC.COM or MOE.2BSD.COM in the directory /pub/2.11BSD. ----------------------------cut here----------------------------- #! /bin/sh # This is a shell archive, meaning: # 1. Remove everything above the #! /bin/sh line. # 2. Save the resulting text in a file. # 3. Execute the file with /bin/sh (not csh) to create: # /tmp/sh.369 # /tmp/shar.369 # /tmp/diffs.369 # This archive created: Tue May 6 23:02:54 1997 export PATH; PATH=/bin:/usr/bin:$PATH if test -f '/tmp/sh.369' then echo shar: "will not over-write existing file '/tmp/sh.369'" else sed 's/^E//' << \SHAR_EOF > '/tmp/sh.369' E#!/bin/sh E Erm -f /usr/src/libexec/getty/gettytab Erm -f /usr/src/ucb/tset/tset.delays.h E Emkdir -p /usr/src/bin/stty Emv /usr/src/man/man1/tset.1 /usr/src/ucb/tset/tset.1 Emv /usr/src/bin/stty.c /usr/src/bin/stty/stty.c Emv /usr/src/man/man1/stty.1 /usr/src/bin/stty/stty.1 SHAR_EOF chmod 755 '/tmp/sh.369' fi if test -f '/tmp/shar.369' then echo shar: "will not over-write existing file '/tmp/shar.369'" else sed 's/^E//' << \SHAR_EOF > '/tmp/shar.369' E#! /bin/sh E# This is a shell archive, meaning: E# 1. Remove everything above the #! /bin/sh line. E# 2. Save the resulting text in a file. E# 3. Execute the file with /bin/sh (not csh) to create: E# /usr/src/sys/h/ioctl_compat.h E# /usr/src/bin/stty/Makefile E# This archive created: Tue May 6 20:28:12 1997 Eexport PATH; PATH=/bin:/usr/bin:$PATH Eif test -f '/usr/src/sys/h/ioctl_compat.h' Ethen E echo shar: "will not over-write existing file '/usr/src/sys/h/ioctl_compat.h'" Eelse Esed 's/^V//' << \SHAR_EOF > '/usr/src/sys/h/ioctl_compat.h' EV/* EV * @(#)ioctl_compat.h 1.0 (2.11BSD SMS) 1997/3/28 EV * EV * These are flags which have (finally) been removed from ioctl.h. Several EV * of these have lacked any kernel support for quite a long time. For others EV * (the delay flags) the kernel support (such as it was) had not been used EV * that anyone could remember and that kernel support has been removed in the EV * interest of streamlining the tty subsystem (as well as making flag bits EV * available for use without expanding the tty structure). EV * EV * All values are 0. Since there is no kernel support at all for any of EV * the flags the only reason to use this file is to avoid having to modify EV * the source to whatever application still references the symbols below. EV*/ EV EV#ifndef _TTY_COMPAT_OBSOLETE EV#define _TTY_COMPAT_OBSOLETE EV EV#define LCASE 0x0 /* (obsolete) place holder */ EV#define NLDELAY 0x0 /* \n delay */ EV#define NL0 0x0 EV#define NL1 0x0 /* tty 37 */ EV#define NL2 0x0 /* vt05 */ EV#define NL3 0x0 EV#define TBDELAY 0x0 /* horizontal tab delay */ EV#define TAB0 0x0 EV#define TAB1 0x0 /* tty 37 */ EV#define TAB2 0x0 EV#define CRDELAY 0x0 /* \r delay */ EV#define CR0 0x0 EV#define CR1 0x0 /* tn 300 */ EV#define CR2 0x0 /* tty 37 */ EV#define CR3 0x0 /* concept 100 */ EV#define VTDELAY 0x0 /* vertical tab delay */ EV#define FF0 0x0 EV#define FF1 0x0 /* tty 37 */ EV#define BSDELAY 0x0 /* \b delay */ EV#define BS0 0x0 EV#define BS1 0x0 EV#define ALLDELAY (NLDELAY|TBDELAY|CRDELAY|VTDELAY|BSDELAY) EV#define TILDE 0x0 /* (obsolete) place holder */ EV#define LTILDE ((int)TILDE>>16)) /* (obsolete) place holder */ EV EV#define L001000 0x0 EV#endif ESHAR_EOF Echmod 644 '/usr/src/sys/h/ioctl_compat.h' Efi Eif test -f '/usr/src/bin/stty/Makefile' Ethen E echo shar: "will not over-write existing file '/usr/src/bin/stty/Makefile'" Eelse Esed 's/^V//' << \SHAR_EOF > '/usr/src/bin/stty/Makefile' EV# EV# Public Domain. 1997/3/27 - Steven Schultz EV# EV# @(#)Makefile 1.0 (2.11BSD) 1997/3/27 EV# EVCFLAGS= -O EVSEPFLAG= -i EVSRCS= stty.c EVOBJS= stty.o EVMAN= stty.0 EVMANSRC= stty.1 EV EVall: stty stty.0 EV EVstty: ${OBJS} EV ${CC} ${CFLAGS} ${SEPFLAG} -o $@ ${OBJS} EV EVstty.0: ${MANSRC} EV /usr/man/manroff ${MANSRC} > ${MAN} EV EVclean: EV rm -f ${OBJS} ${MAN} stty tags EV EVdepend: ${SRCS} EV mkdep ${CFLAGS} ${SRCS} EV EVinstall: stty EV install -c -o bin -g bin -m 444 ${MAN} ${DESTDIR}/usr/man/cat1 EV install -s -o root -g bin -m 755 stty ${DESTDIR}/bin/stty EV EVlint: ${SRCS} EV lint -hax ${SRCS} EV EVtags: ${SRCS} EV ctags ${SRCS} EV# DO NOT DELETE THIS LINE -- mkdep uses it. EV# DO NOT PUT ANYTHING AFTER THIS LINE, IT WILL GO AWAY. ESHAR_EOF Echmod 644 '/usr/src/bin/stty/Makefile' Efi Eexit 0 E# End of shell archive SHAR_EOF chmod 644 '/tmp/shar.369' fi if test -f '/tmp/diffs.369' then echo shar: "will not over-write existing file '/tmp/diffs.369'" else sed 's/^E//' << \SHAR_EOF > '/tmp/diffs.369' E*** /etc/gettytab.old Sun Dec 1 15:35:15 1996 E--- /etc/gettytab Fri Mar 28 21:01:16 1997 E*************** E*** 2,8 **** E # All rights reserved. The Berkeley software License Agreement E # specifies the terms and conditions for redistribution. E # E! # @(#)gettytab 5.7.1 (2.11BSD GTE) 12/9/94 E # E # E # Most of the table entries here are just copies of the E--- 2,8 ---- E # All rights reserved. The Berkeley software License Agreement E # specifies the terms and conditions for redistribution. E # E! # @(#)gettytab 5.7.2 (2.11BSD GTE) 1997/3/28 E # E # E # Most of the table entries here are just copies of the E*************** E*** 16,22 **** E # entries, and in cases where getty is called with no table name E # E default:\ E! :ap:fd#1000:im=\r\n\r\n2.11 BSD UNIX (%h) (%t)\r\n\r\r\n\r:sp#1200: E E # E # Fixed speed entries E--- 16,22 ---- E # entries, and in cases where getty is called with no table name E # E default:\ E! :ap:im=\r\n\r\n2.11 BSD UNIX (%h) (%t)\r\n\r\r\n\r:sp#1200: E E # E # Fixed speed entries E*************** E*** 29,45 **** E # be assigned to any table desired (hopefully the same speed). E # E a|std.110|110-baud:\ E! :nd#1:cd#1:sp#110: E b|std.134|134.5-baud:\ E! :ep:nd#1:cd#2:ff#1:td#1:sp#134:ht:nl: E 1|std.150|150-baud:\ E! :ep:nd#1:cd#2:td#1:fd#1:sp#150:ht:nl:lm=\E\72\6\6\17login\72 : E c|std.300|300-baud:\ E! :nd#1:cd#1:sp#300: E d|std.600|600-baud:\ E! :nd#1:cd#1:sp#600: E f|std.1200|1200-baud:\ E! :fd#1:sp#1200: E 6|std.2400|2400-baud:\ E :sp#2400:ht: E 7|std.4800|4800-baud:\ E--- 29,45 ---- E # be assigned to any table desired (hopefully the same speed). E # E a|std.110|110-baud:\ E! :sp#110: E b|std.134|134.5-baud:\ E! :ep:sp#134:ht:nl: E 1|std.150|150-baud:\ E! :ep:sp#150:ht:nl:lm=\E\72\6\6\17login\72 : E c|std.300|300-baud:\ E! :sp#300: E d|std.600|600-baud:\ E! :sp#600: E f|std.1200|1200-baud:\ E! :sp#1200: E 6|std.2400|2400-baud:\ E :sp#2400:ht: E 7|std.4800|4800-baud:\ E*************** E*** 50,61 **** E :sp#19200: E E # E # Dial in rotary tables, speed selection via 'break' E # E 0|d300|Dial-300:\ E! :nx=d1200:cd#2:sp#300: E d1200|Dial-1200:\ E! :nx=d150:fd#1:sp#1200: E d150|Dial-150:\ E :nx=d110:lm@:tc=150-baud: E d110|Dial-110:\ E--- 50,68 ---- E :sp#19200: E E # E+ # Hardware flow control lines E+ # E+ t9600-hf:hf:sp#9600 E+ t19200-hf:hf:sp#19200 E+ t38400-hf:hf:sp#38400 E+ E+ # E # Dial in rotary tables, speed selection via 'break' E # E 0|d300|Dial-300:\ E! :nx=d1200:sp#300: E d1200|Dial-1200:\ E! :nx=d150:sp#1200: E d150|Dial-150:\ E :nx=d110:lm@:tc=150-baud: E d110|Dial-110:\ E*************** E*** 68,83 **** E :tc=110-baud: E E 4|Console|Console Decwriter II:\ E! :nd@:cd@:rw:tc=300-baud: E E e|Console-1200|Console Decwriter III:\ E! :fd@:nd@:cd@:rw:tc=1200-baud: E E l|lsi chess terminal:\ E :sp#300: E E X|Xwindow|X window system:\ E! :fd@:nd@:cd@:rw:sp#9600: E E # E # Fast dialup terminals, 2400/1200/300 rotary (can start either way) E--- 75,90 ---- E :tc=110-baud: E E 4|Console|Console Decwriter II:\ E! :rw:tc=300-baud: E E e|Console-1200|Console Decwriter III:\ E! :rw:tc=1200-baud: E E l|lsi chess terminal:\ E :sp#300: E E X|Xwindow|X window system:\ E! :rw:sp#9600: E E # E # Fast dialup terminals, 2400/1200/300 rotary (can start either way) E*** /usr/src/bin/Makefile.old Fri Jan 10 22:01:43 1997 E--- /usr/src/bin/Makefile Thu Mar 27 19:31:42 1997 E*************** E*** 3,9 **** E # All rights reserved. The Berkeley software License Agreement E # specifies the terms and conditions for redistribution. E # E! # @(#)Makefile 5.19.9 (2.11BSD GTE) 1997/1/10 E # E DESTDIR= E CFLAGS= -O E--- 3,9 ---- E # All rights reserved. The Berkeley software License Agreement E # specifies the terms and conditions for redistribution. E # E! # @(#)Makefile 5.19.10 (2.11BSD GTE) 1997/3/27 E # E DESTDIR= E CFLAGS= -O E*************** E*** 12,18 **** E # Programs that live in subdirectories, and have makefiles of their own. E # E SUBDIR= adb ar as awk chflags chpass csh diff disklabel hostname ld login \ E! ls make nm passwd ping sed sh sysctl tcsh test tp E E # Shell scripts that need only be installed and are never removed. E # E--- 12,18 ---- E # Programs that live in subdirectories, and have makefiles of their own. E # E SUBDIR= adb ar as awk chflags chpass csh diff disklabel hostname ld login \ E! ls make nm passwd ping sed sh stty sysctl tcsh test tp E E # Shell scripts that need only be installed and are never removed. E # E*************** E*** 23,29 **** E # E STD= cat cc chgrp chmod cmp cp date dd du echo ed grep hostid \ E kill ln mkdir mt mv nice od pagesize pr \ E! pwd rm rmail rmdir size stty sync tar tee time who E E # C programs that live in the current directory and need explicit make lines. E # E--- 23,29 ---- E # E STD= cat cc chgrp chmod cmp cp date dd du echo ed grep hostid \ E kill ln mkdir mt mv nice od pagesize pr \ E! pwd rm rmail rmdir size sync tar tee time who E E # C programs that live in the current directory and need explicit make lines. E # E*** /usr/src/bin/stty/stty.1.old Sun Dec 14 15:06:15 1986 E--- /usr/src/bin/stty/stty.1 Fri May 2 20:39:16 1997 E*************** E*** 2,16 **** E .\" All rights reserved. The Berkeley software License Agreement E .\" specifies the terms and conditions for redistribution. E .\" E! .\" @(#)stty.1 6.4 (Berkeley) 5/5/86 E .\" E! .TH STTY 1 "May 5, 1986" E .UC 4 E .SH NAME E stty \- set terminal options E .SH SYNOPSIS E .B stty E! [ option ... ] E .SH DESCRIPTION E .I Stty E sets certain I/O options on the current output terminal, E--- 2,18 ---- E .\" All rights reserved. The Berkeley software License Agreement E .\" specifies the terms and conditions for redistribution. E .\" E! .\" @(#)stty.1 6.4.1 (2.11BSD) 1997/5/2 E .\" E! .TH STTY 1 "March 27, 1997" E .UC 4 E .SH NAME E stty \- set terminal options E .SH SYNOPSIS E .B stty E! [\fB\-a | \-e\fP] E! [\fB-f\fP \fIfile\fP] E! [operands] E .SH DESCRIPTION E .I Stty E sets certain I/O options on the current output terminal, E*************** E*** 17,41 **** E placing its output on the diagnostic output. E With no argument, it reports the speed of the terminal and the E settings of the options which are different from their defaults. E! Use of one of the following options modifies the output as described: E .TP 10 E! .B all E! All normally used option settings are reported. E .TP 10 E! .B everything E Everything E .I stty E knows about is printed. E! .TP 10 E .B speed E The terminal speed alone is printed on the standard output. E! .TP 10 E .B size E The terminal (window) sizes are printed on the standard output, E first rows and then columns. E! .sp E! The option strings are E! selected from the following set: E .TP 10 E .B even E allow even parity input E--- 19,63 ---- E placing its output on the diagnostic output. E With no argument, it reports the speed of the terminal and the E settings of the options which are different from their defaults. E! .PP E! The following options are available: E .TP 10 E! \fB\-a\fP E! Display everything \fIstty\fP knows. This has the same effect E! as using the operand \fBall\fP or \fBeverything\fP. The distinction between E! \fBall\fP and \fBeverything\fP has been removed. E .TP 10 E! \fB\-e\fP E! Same a \fB\-a\fP above. E! .TP 10 E! \fB\-f\fP E! Open and use the terminal named by \fIfile\fP rather than using standard E! output. The file is opened using the O_NONBLOCK flag of \fBopen\fP(), E! making it possible to set or display settings on a terminal that might E! otherwise block on the open. E! .PP E! The following operands are special: E! .TP 12 E! .B all E Everything E .I stty E knows about is printed. E! .TP 12 E! .B everything E! Same as \fBall\fP above. E! .TP 12 E! .B flushout E! Flush the queues for the device. This is most useful when an exiting E! process is stuck waiting for terminal output to drain. E! .TP 12 E .B speed E The terminal speed alone is printed on the standard output. E! .TP 12 E .B size E The terminal (window) sizes are printed on the standard output, E first rows and then columns. E! .PP E! \fIOperands\fP are selected from the following: E .TP 10 E .B even E allow even parity input E*************** E*** 44,51 **** E .TP 10 E .B \-even E disallow even parity input E- .br E- .ns E .TP 10 E .B odd E allow odd parity input E--- 66,71 ---- E*************** E*** 54,61 **** E .TP 10 E .B \-odd E disallow odd parity input E- .br E- .ns E .TP 10 E .B raw E raw mode input E--- 74,79 ---- E*************** E*** 65,77 **** E .TP 10 E .B \-raw E negate raw mode E- .br E- .ns E .TP 10 E .B cooked E same as `\-raw' E- .br E- .ns E .TP 10 E .B cbreak E make each character available to E--- 83,91 ---- E*************** E*** 85,92 **** E make characters available to E .I read E only when newline is received E- .br E- .ns E .TP 10 E .B \-nl E allow carriage return for new-line, E--- 99,104 ---- E*************** E*** 96,103 **** E .TP 10 E .B nl E accept only new-line to end lines E- .br E- .ns E .TP 10 E .B echo E echo back every character typed E--- 108,113 ---- E*************** E*** 106,126 **** E .TP 10 E .B \-echo E do not echo characters E- .br E- .ns E .TP 10 E- .B lcase E- map upper case to lower case E- .br E- .ns E- .TP 10 E- .B \-lcase E- do not map case E- .br E- .ns E- .TP 10 E .B tandem E! enable flow control, so that the system sends out the stop character when E its internal queue is in danger of overflowing on input, and sends the E start character when it is ready to accept further input E .br E--- 116,125 ---- E .TP 10 E .B \-echo E do not echo characters E .TP 10 E .B tandem E! enable inbound software (xon/xoff) flow control, so that the system sends E! out the stop character when E its internal queue is in danger of overflowing on input, and sends the E start character when it is ready to accept further input E .br E*************** E*** 127,135 **** E .ns E .TP 10 E .B \-tandem E! disable flow control E! .br E! .ns E .TP 10 E .B \-tabs E replace tabs by spaces when printing E--- 126,132 ---- E .ns E .TP 10 E .B \-tandem E! disable inbound software (xon/xoff) flow control E .TP 10 E .B \-tabs E replace tabs by spaces when printing E*************** E*** 139,153 **** E .B tabs E preserve tabs E .br E- .ns E- .TP 10 E- .B ek E- set erase and kill characters to # and @ E- .br E- .ns E .PP E For the following commands which take a character argument \fIc\fR, E! you may also specify \fIc\fR as the ``u'' or ``undef'', to set the value E to be undefined. A value of ``^x'', a 2 character sequence, is also E interpreted as a control character, with ``^?'' representing delete. E .TP 10 E--- 136,144 ---- E .B tabs E preserve tabs E .br E .PP E For the following commands which take a character argument \fIc\fR, E! you may also specify \fIc\fR as ``undef'', to set the value E to be undefined. A value of ``^x'', a 2 character sequence, is also E interpreted as a control character, with ``^?'' representing delete. E .TP 10 E*************** E*** 208,258 **** E .br E .ns E .TP 10 E- .B cr0 cr1 cr2 cr3 E- .br E- select style of delay for carriage return (see E- .IR ioctl (2)) E- .br E- .ns E- .TP 10 E- .B nl0 nl1 nl2 nl3 E- .br E- select style of delay for linefeed E- .br E- .ns E- .TP 10 E- .B tab0 tab1 tab2 tab3 E- .br E- select style of delay for tab E- .br E- .ns E- .TP 10 E- .B ff0 ff1 E- select style of delay for form feed E- .br E- .ns E- .TP 10 E- .B bs0 bs1 E- select style of delay for backspace E- .br E- .TP 10 E- .B tty33 E- set all modes suitable for the E- Teletype Corporation Model 33 terminal. E- .br E- .ns E- .TP 10 E- .B tty37 E- set all modes suitable for the E- Teletype Corporation Model 37 terminal. E- .br E- .ns E- .TP 10 E- .B vt05 E- set all modes suitable for Digital Equipment Corp. VT05 terminal E- .br E- .ns E- .TP 10 E .B dec E set all modes suitable for Digital Equipment Corp. operating systems E users; (erase, kill, and interrupt characters to ^?, ^U, and ^C, E--- 199,204 ---- E*************** E*** 259,279 **** E decctlq and ``newcrt''.) E .ns E .TP 10 E- .B tn300 E- set all modes suitable for a General Electric TermiNet 300 E- .br E- .ns E- .TP 10 E- .B ti700 E- set all modes suitable for Texas Instruments 700 series terminal E- .br E- .ns E- .TP 10 E- .B tek E- set all modes suitable for Tektronix 4014 terminal E- .br E- .ns E- .TP 10 E .B 0 E hang up phone line immediately E .br E--- 205,210 ---- E*************** E*** 312,329 **** E .B crt E Set options for a CRT (crtbs, ctlecho and, if >= 1200 baud, E crterase and crtkill.) E- .br E- .ns E .TP 10 E .B crtbs E Echo backspaces on erase characters. E- .br E- .ns E .TP 10 E .B prterase E For printing terminal echo erased characters backwards within ``\e'' and ``/''. E- .br E- .ns E .TP 10 E .B crterase E Wipe out erased characters with ``backspace-space-backspace.'' E--- 243,254 ---- E*************** E*** 332,350 **** E .TP 10 E .B \-crterase E Leave erased characters visible; just backspace. E- .br E- .ns E .TP 10 E .B crtkill E! Wipe out input on like kill ala E! .B crterase. E .br E .ns E .TP 10 E .B \-crtkill E Just echo line kill character and a newline on line kill. E- .br E- .ns E .TP 10 E .B ctlecho E Echo control characters as ``^\fIx\fR'' (and delete as ``^?''.) E--- 257,270 ---- E .TP 10 E .B \-crterase E Leave erased characters visible; just backspace. E .TP 10 E .B crtkill E! Wipe out input on like kill ala \fBcrterase\fP. E .br E .ns E .TP 10 E .B \-crtkill E Just echo line kill character and a newline on line kill. E .TP 10 E .B ctlecho E Echo control characters as ``^\fIx\fR'' (and delete as ``^?''.) E*************** E*** 360,372 **** E After output is suspended (normally by ^S), only a start character E (normally ^Q) will restart it. This is compatible with DEC's vendor E supplied systems. E .TP 10 E .B \-decctlq E After output is suspended, any character typed will restart it; E the start character will restart output without providing any input. E (This is the default.) E- .br E- .ns E .TP 10 E .B tostop E Background jobs stop if they attempt terminal output. E--- 280,292 ---- E After output is suspended (normally by ^S), only a start character E (normally ^Q) will restart it. This is compatible with DEC's vendor E supplied systems. E+ .br E+ .ns E .TP 10 E .B \-decctlq E After output is suspended, any character typed will restart it; E the start character will restart output without providing any input. E (This is the default.) E .TP 10 E .B tostop E Background jobs stop if they attempt terminal output. E*************** E*** 375,393 **** E .TP 10 E .B \-tostop E Output from background jobs to the terminal is allowed. E- .br E- .ns E .TP 10 E- .B tilde E- Convert ``~'' to ``\`'' on output (for Hazeltine terminals). E- .br E- .ns E- .TP 10 E- .B \-tilde E- Leave poor ``~'' alone. E- .br E- .ns E- .TP 10 E .B flusho E Output is being discarded usually because user hit control O (internal state bit). E .br E--- 295,301 ---- E*************** E*** 395,402 **** E .TP 10 E .B \-flusho E Output is not being discarded. E- .br E- .ns E .TP 10 E .B pendin E Input is pending after a switch from cbreak to cooked E--- 303,308 ---- E*************** E*** 407,414 **** E .TP 10 E .B \-pendin E Input is not pending. E- .br E- .ns E .TP 10 E .B pass8 E Passes all 8 bits through on input, in any mode. E--- 313,318 ---- E*************** E*** 417,424 **** E .TP 10 E .B \-pass8 E Strips the 0200 bit on input except in raw mode. E- .br E- .ns E .TP 10 E .B mdmbuf E Start/stop output on carrier transitions (not implemented). E--- 321,326 ---- E*************** E*** 427,434 **** E .TP 10 E .B \-mdmbuf E Return error if write attempted after carrier drops. E- .br E- .ns E .TP 10 E .B litout E Send output characters without any processing. E--- 329,334 ---- E*************** E*** 437,444 **** E .TP 10 E .B \-litout E Do normal output processing, inserting delays, etc. E- .br E- .ns E .TP 10 E .B nohang E Don't send hangup signal if carrier drops. E--- 337,342 ---- E*************** E*** 447,457 **** E .TP 10 E .B \-nohang E Send hangup signal to control process group when carrier drops. E- .br E- .ns E- .TP 10 E- .B etxack E- Diablo style etx/ack handshaking (not implemented). E .PP E The following special characters are applicable only to the new E teletype driver E--- 345,350 ---- E*************** E*** 484,488 **** E--- 377,409 ---- E .TP 10 E .BI lnext \ c\fR E set literal next character to \fIc\fR (default control V). E+ .PP E+ .B Modem Control Status: E+ .sp E+ These display the current state of modem control. E+ They are only displayed for actual tty lines and not for pseudo tty E+ lines (more precisely, it is only displayed for lines which support E+ the TIOCMGET ioctl. See tty(4). E+ .br E+ .ns E+ While it is possible to change the state of the modem control lines, E+ the hardware or other software may prevent the change from actually E+ taking place, E+ or may cause the state to immediately revert to the original state. E+ .TP 15 E+ \fBdcd\fP (\fB\-dcd\fP) E+ State of Data Carrier Detect. E+ .TP 15 E+ \fBdsr\fP (\fB\-dsr\fP) E+ State of Data Set Ready. E+ .TP 15 E+ \fBdtr\fP (\fB\-dtr\fP) E+ State of Data Terminal Ready. E+ .TP 15 E+ \fBcts\fP (\fB\-cts\fP) E+ State of Clear To Send. E+ .TP 15 E+ \fBrts\fP (\fB\-rts\fP) E+ State of Request To Send. E .SH "SEE ALSO" E ioctl(2), tabs(1), tset(1), tty(4) E*** /usr/src/bin/stty/stty.c.old Fri Dec 9 20:18:34 1994 E--- /usr/src/bin/stty/stty.c Fri May 2 17:51:17 1997 E*************** E*** 9,15 **** E "@(#) Copyright (c) 1980 Regents of the University of California.\n\ E All rights reserved.\n"; E E! static char sccsid[] = "@(#)stty.c 5.4.1 (2.11BSD GTE) 12/9/94"; E #endif E E /* E--- 9,15 ---- E "@(#) Copyright (c) 1980 Regents of the University of California.\n\ E All rights reserved.\n"; E E! static char sccsid[] = "@(#)stty.c 5.4.2 (2.11BSD GTE) 1997/5/2"; E #endif E E /* E*************** E*** 18,23 **** E--- 18,26 ---- E E #include E #include E+ #include E+ #include E+ #include E E struct E { E*************** E*** 45,133 **** E "38400", EXTB, E 0, E }; E! struct E! { E char *string; E int set; E int reset; E! int lset; E! int lreset; E! } modes[] = { E! "even", EVENP, 0, 0, 0, E! "-even", 0, EVENP, 0, 0, E! "odd", ODDP, 0, 0, 0, E! "-odd", 0, ODDP, 0, 0, E! "raw", RAW, 0, 0, 0, E! "-raw", 0, RAW, 0, 0, E! "cooked", 0, RAW, 0, 0, E! "-nl", CRMOD, 0, 0, 0, E! "nl", 0, CRMOD, 0, 0, E! "echo", ECHO, 0, 0, 0, E! "-echo", 0, ECHO, 0, 0, E! "-tabs", XTABS, 0, 0, 0, E! "tabs", 0, XTABS, 0, 0, E! "tandem", TANDEM, 0, 0, 0, E! "-tandem", 0, TANDEM, 0, 0, E! "cbreak", CBREAK, 0, 0, 0, E! "-cbreak", 0, CBREAK, 0, 0, E! "cr0", CR0, CR3, 0, 0, E! "cr1", CR1, CR3, 0, 0, E! "cr2", CR2, CR3, 0, 0, E! "cr3", CR3, CR3, 0, 0, E! "tab0", TAB0, XTABS, 0, 0, E! "tab1", TAB1, XTABS, 0, 0, E! "tab2", TAB2, XTABS, 0, 0, E! "nl0", NL0, NL3, 0, 0, E! "nl1", NL1, NL3, 0, 0, E! "nl2", NL2, NL3, 0, 0, E! "nl3", NL3, NL3, 0, 0, E! "ff0", FF0, FF1, 0, 0, E! "ff1", FF1, FF1, 0, 0, E! "bs0", BS0, BS1, 0, 0, E! "bs1", BS1, BS1, 0, 0, E! "33", CR1, ALLDELAY, 0, 0, E! "tty33", CR1, ALLDELAY, 0, 0, E! "37", FF1+CR2+TAB1+NL1, ALLDELAY, 0, 0, E! "tty37", FF1+CR2+TAB1+NL1, ALLDELAY, 0, 0, E! "05", NL2, ALLDELAY, 0, 0, E! "vt05", NL2, ALLDELAY, 0, 0, E! "tn", CR1, ALLDELAY, 0, 0, E! "tn300", CR1, ALLDELAY, 0, 0, E! "ti", CR2, ALLDELAY, 0, 0, E! "ti700", CR2, ALLDELAY, 0, 0, E! "tek", FF1, ALLDELAY, 0, 0, E! "crtbs", 0, 0, LCRTBS, LPRTERA, E! "-crtbs", 0, 0, 0, LCRTBS, E! "prterase", 0, 0, LPRTERA, LCRTBS+LCRTKIL+LCRTERA, E! "-prterase", 0, 0, 0, LPRTERA, E! "crterase", 0, 0, LCRTERA, LPRTERA, E! "-crterase", 0, 0, 0, LCRTERA, E! "crtkill", 0, 0, LCRTKIL, LPRTERA, E! "-crtkill", 0, 0, 0, LCRTKIL, E! "mdmbuf", 0, 0, LMDMBUF, 0, E! "-mdmbuf", 0, 0, 0, LMDMBUF, E! "litout", 0, 0, LLITOUT, 0, E! "-litout", 0, 0, 0, LLITOUT, E! "pass8", 0, 0, LPASS8, 0, E! "-pass8", 0, 0, 0, LPASS8, E! "tostop", 0, 0, LTOSTOP, 0, E! "-tostop", 0, 0, 0, LTOSTOP, E! "flusho", 0, 0, LFLUSHO, 0, E! "-flusho", 0, 0, 0, LFLUSHO, E! "nohang", 0, 0, LNOHANG, 0, E! "-nohang", 0, 0, 0, LNOHANG, E! #ifdef notdef E! "etxack", 0, 0, LETXACK, 0, E! "-etxack", 0, 0, 0, LETXACK, E! #endif E! "ctlecho", 0, 0, LCTLECH, 0, E! "-ctlecho", 0, 0, 0, LCTLECH, E! "pendin", 0, 0, LPENDIN, 0, E! "-pendin", 0, 0, 0, LPENDIN, E! "decctlq", 0, 0, LDECCTQ, 0, E! "-decctlq", 0, 0, 0, LDECCTQ, E! "noflsh", 0, 0, LNOFLSH, 0, E! "-noflsh", 0, 0, 0, LNOFLSH, E 0, E }; E E--- 48,131 ---- E "38400", EXTB, E 0, E }; E! E! unsigned speed[] = { E! 0,50,75,110,134,150,200,300,600,1200,1800,2400,4800,9600,19200,38400 E! }; E! E! struct MODES E! { E char *string; E int set; E int reset; E! }; E! E! struct MODES modes[] = { E! "even", EVENP, 0, E! "-even", 0, EVENP, E! "odd", ODDP, 0, E! "-odd", 0, ODDP, E! "raw", RAW, 0, E! "-raw", 0, RAW, E! "cooked", 0, RAW, E! "-nl", CRMOD, 0, E! "nl", 0, CRMOD, E! "echo", ECHO, 0, E! "-echo", 0, ECHO, E! "-tabs", XTABS, 0, E! "tabs", 0, XTABS, E! "tandem", TANDEM, 0, E! "-tandem", 0, TANDEM, E! "cbreak", CBREAK, 0, E! "-cbreak", 0, CBREAK, E! 0 E! }; E! E! struct MODES lmodes[] = { E! "rtscts", LRTSCTS, 0, E! "-rtscts", 0, LRTSCTS, E! "crtbs", LCRTBS, LPRTERA, E! "-crtbs", 0, LCRTBS, E! "prterase", LPRTERA, LCRTBS+LCRTKIL+LCRTERA, E! "-prterase", 0, LPRTERA, E! "crterase", LCRTERA, LPRTERA, E! "-crterase", 0, LCRTERA, E! "crtkill", LCRTKIL, LPRTERA, E! "-crtkill", 0, LCRTKIL, E! "mdmbuf", LMDMBUF, 0, E! "-mdmbuf", 0, LMDMBUF, E! "litout", LLITOUT, 0, E! "-litout", 0, LLITOUT, E! "pass8", LPASS8, 0, E! "-pass8", 0, LPASS8, E! "tostop", LTOSTOP, 0, E! "-tostop", 0, LTOSTOP, E! "flusho", LFLUSHO, 0, E! "-flusho", 0, LFLUSHO, E! "nohang", LNOHANG, 0, E! "-nohang", 0, LNOHANG, E! "ctlecho", LCTLECH, 0, E! "-ctlecho", 0, LCTLECH, E! "pendin", LPENDIN, 0, E! "-pendin", 0, LPENDIN, E! "decctlq", LDECCTQ, 0, E! "-decctlq", 0, LDECCTQ, E! "noflsh", LNOFLSH, 0, E! "-noflsh", 0, LNOFLSH, E! 0 E! }; E! E! struct MODES mmodes[] = { E! "dcd", TIOCM_CD, 0, E! "-dcd", 0, TIOCM_CD, E! "dsr", TIOCM_DSR, 0, E! "-dsr", 0, TIOCM_DSR, E! "dtr", TIOCM_DTR, 0, E! "-dtr", 0, TIOCM_DTR, E! "cts", TIOCM_CTS, 0, E! "-cts", 0, TIOCM_CTS, E! "rts", TIOCM_RTS, 0, E! "-rts", 0, TIOCM_RTS, E 0, E }; E E*************** E*** 136,142 **** E struct sgttyb mode; E struct winsize win; E int lmode; E! int oldisc, ldisc; E E struct special { E char *name; E--- 134,141 ---- E struct sgttyb mode; E struct winsize win; E int lmode; E! int ldisc; E! int mstate, nmstate; E E struct special { E char *name; E*************** E*** 159,210 **** E "lnext", <c.t_lnextc, CLNEXT, E 0 E }; E char *arg; E E! int argc; E! char **argv; E! main(iargc, iargv) E! char **iargv; E { E! int i; E register struct special *sp; E! char obuf[BUFSIZ]; E E setbuf(stderr, obuf); E! argc = iargc; E! argv = iargv; E ioctl(1, TIOCGETP, &mode); E ioctl(1, TIOCGETD, &ldisc); E- oldisc = ldisc; E ioctl(1, TIOCGETC, &tc); E ioctl(1, TIOCLGET, &lmode); E ioctl(1, TIOCGLTC, <c); E ioctl(1, TIOCGWINSZ, &win); E! if(argc == 1) { E! prmodes(0); E exit(0); E } E! if (argc == 2 && !strcmp(argv[1], "all")) { E! prmodes(1); E! exit(0); E! } E! if (argc == 2 && !strcmp(argv[1], "everything")) { E prmodes(2); E exit(0); E } E! /* E! if (argc == 2 && !strcmp(argv[1], "all")) { E! prmodes(2); E! exit(0); E! } E! */ E! while(--argc > 0) { E! arg = *++argv; E! if (eq("ek")){ E! mode.sg_erase = '#'; E! mode.sg_kill = '@'; E! continue; E! } E if (eq("new")){ E ldisc = NTTYDISC; E if (ioctl(1, TIOCSETD, &ldisc)<0) E--- 158,231 ---- E "lnext", <c.t_lnextc, CLNEXT, E 0 E }; E+ E char *arg; E+ char *Nfmt = "%-8s"; E E! main(argc, argv) E! int argc; E! register char **argv; E { E! int i, fmt = 0, ch, zero = 0; E register struct special *sp; E! char obuf[BUFSIZ]; E! char *arg2; E E setbuf(stderr, obuf); E! E! opterr = 0; E! while (optind < argc && strspn(argv[optind], "-aef") == strlen(argv[optind]) && E! (ch = getopt(argc, argv, "aef:")) != EOF) E! { E! switch (ch) E! { E! case 'e': E! case 'a': E! fmt = 2; E! break; E! case 'f': E! i = open(optarg, O_RDONLY|O_NONBLOCK); E! if (i < 0) E! err(1, "%s", optarg); E! if (dup2(i, 1) < 0) E! err(1, "dup2(%d,1)", i); E! break; E! case '?': E! default: E! goto args; E! } E! } E! args: E! argc -= optind; E! argv += optind; E! E ioctl(1, TIOCGETP, &mode); E ioctl(1, TIOCGETD, &ldisc); E ioctl(1, TIOCGETC, &tc); E ioctl(1, TIOCLGET, &lmode); E ioctl(1, TIOCGLTC, <c); E ioctl(1, TIOCGWINSZ, &win); E! if (ioctl(1, TIOCMGET, &mstate) < 0) E! { E! if (errno == ENOTTY) E! mstate = -1; E! else E! warn("TIOCMGET"); E! } E! nmstate = mstate; E! E! if (argc == 0) { E! prmodes(fmt); E exit(0); E } E! arg = argv[1]; E! if (argc == 1 && (!strcmp(arg, "everything") || !strcmp(arg, "all"))) { E prmodes(2); E exit(0); E } E! E! while (argc-- > 0) { E! arg = *argv++; E if (eq("new")){ E ldisc = NTTYDISC; E if (ioctl(1, TIOCSETD, &ldisc)<0) E*************** E*** 249,286 **** E } E for (sp = special; sp->name; sp++) E if (eq(sp->name)) { E! if (--argc == 0) E goto done; E! if (**++argv == 'u') E *sp->cp = 0377; E! else if (**argv == '^') E! *sp->cp = ((*argv)[1] == '?') ? E! 0177 : (*argv)[1] & 037; E else E! *sp->cp = **argv; E goto cont; E } E! if (eq("gspeed")) { E! mode.sg_ispeed = B300; E! mode.sg_ospeed = B9600; E continue; E! } E if (eq("hup")) { E ioctl(1, TIOCHPCL, NULL); E continue; E } E if (eq("rows")) { E! if (--argc == 0) E goto done; E! win.ws_row = atoi(*++argv); E } E if (eq("cols") || eq("columns")) { E! if (--argc == 0) E goto done; E! win.ws_col = atoi(*++argv); E } E if (eq("size")) { E- ioctl(open("/dev/tty", 0), TIOCGWINSZ, &win); E printf("%d %d\n", win.ws_row, win.ws_col); E exit(0); E } E--- 270,310 ---- E } E for (sp = special; sp->name; sp++) E if (eq(sp->name)) { E! if (argc-- == 0) E goto done; E! arg2 = *argv++; E! if (strcmp(arg2, "undef") == 0) E *sp->cp = 0377; E! else if (*arg2 == '^') E! { E! arg2++; E! *sp->cp = (*arg2 == '?') ? E! 0177 : *arg2 & 037; E! } E else E! *sp->cp = *arg2; E goto cont; E } E! if (eq("flushout")) E! { E! ioctl(1, TIOCFLUSH, &zero); E continue; E! } E if (eq("hup")) { E ioctl(1, TIOCHPCL, NULL); E continue; E } E if (eq("rows")) { E! if (argc-- == 0) E goto done; E! win.ws_row = atoi(*argv++); E } E if (eq("cols") || eq("columns")) { E! if (argc-- == 0) E goto done; E! win.ws_col = atoi(*argv++); E } E if (eq("size")) { E printf("%d %d\n", win.ws_row, win.ws_col); E exit(0); E } E*************** E*** 290,296 **** E goto cont; E } E if (eq("speed")) { E- ioctl(open("/dev/tty", 0), TIOCGETP, &mode); E for(i=0; speeds[i].string; i++) E if (mode.sg_ospeed == speeds[i].speed) { E printf("%s\n", speeds[i].string); E--- 314,319 ---- E*************** E*** 299,311 **** E printf("unknown\n"); E exit(1); E } E! for(i=0; modes[i].string; i++) E! if(eq(modes[i].string)) { E mode.sg_flags &= ~modes[i].reset; E mode.sg_flags |= modes[i].set; E! lmode &= ~modes[i].lreset; E! lmode |= modes[i].lset; E } E if(arg) E fprintf(stderr,"unknown mode: %s\n", arg); E cont: E--- 322,351 ---- E printf("unknown\n"); E exit(1); E } E! for (i = 0; modes[0].string; i++) E! { E! if (eq(modes[i].string)) E! { E mode.sg_flags &= ~modes[i].reset; E mode.sg_flags |= modes[i].set; E! } E } E+ for (i = 0; lmodes[0].string; i++) E+ { E+ if (eq(lmodes[i].string)) E+ { E+ lmode &= ~lmodes[i].reset; E+ lmode |= lmodes[i].set; E+ } E+ } E+ for (i = 0; mmodes[0].string; i++) E+ { E+ if (eq(mmodes[i].string)) E+ { E+ nmstate &= ~mmodes[i].reset; E+ nmstate |= mmodes[i].set; E+ } E+ } E if(arg) E fprintf(stderr,"unknown mode: %s\n", arg); E cont: E*************** E*** 317,328 **** E ioctl(1, TIOCSLTC, <c); E ioctl(1, TIOCLSET, &lmode); E ioctl(1, TIOCSWINSZ, &win); E } E E eq(string) E char *string; E { E! int i; E E if(!arg) E return(0); E--- 357,373 ---- E ioctl(1, TIOCSLTC, <c); E ioctl(1, TIOCLSET, &lmode); E ioctl(1, TIOCSWINSZ, &win); E+ if (mstate != -1 && nmstate != mstate) E+ { E+ if (ioctl(1, TIOCMSET, &nmstate) < 0) E+ warn("TIOCMSET"); E+ } E } E E eq(string) E char *string; E { E! register int i; E E if(!arg) E return(0); E*************** E*** 336,392 **** E return(1); E } E E prmodes(all) E { E register m; E! int any; E E if(ldisc==NETLDISC) E fprintf(stderr, "net discipline, "); E! else if(ldisc==NTTYDISC) E fprintf(stderr, "new tty, "); E! else if(all==2) E fprintf(stderr, "old tty, "); E if(mode.sg_ispeed != mode.sg_ospeed) { E! prspeed("input speed ", mode.sg_ispeed); E! prspeed("output speed ", mode.sg_ospeed); E } else E! prspeed("speed ", mode.sg_ispeed); E if (all) E fprintf(stderr, ", %d rows, %d columns", win.ws_row, win.ws_col); E! fprintf(stderr, all==2 ? "\n" : "; "); E m = mode.sg_flags; E! if(all==2 || (m&(EVENP|ODDP))!=(EVENP|ODDP)) { E if(m & EVENP) fprintf(stderr,"even "); E if(m & ODDP) fprintf(stderr,"odd "); E } E! if(all==2 || m&RAW) E fprintf(stderr,"-raw "+((m&RAW)!=0)); E! if(all==2 || (m&CRMOD)==0) E fprintf(stderr,"-nl "+((m&CRMOD)==0)); E! if(all==2 || (m&ECHO)==0) E fprintf(stderr,"-echo "+((m&ECHO)!=0)); E! if(all==2 || (m&TANDEM)) E fprintf(stderr,"-tandem "+((m&TANDEM)!=0)); E fprintf(stderr,"-tabs "+((m&XTABS)!=XTABS)); E! if(all==2 || (m&CBREAK)) E fprintf(stderr,"-cbreak "+((m&CBREAK)!=0)); E! if(all==2 || (m&NLDELAY)) E! delay((m&NLDELAY)/NL1, "nl"); E! if ((m&TBDELAY)!=XTABS) E! delay((m&TBDELAY)/TAB1, "tab"); E! if(all==2 || (m&CRDELAY)) E! delay((m&CRDELAY)/CR1, "cr"); E! if(all==2 || (m&VTDELAY)) E! delay((m&VTDELAY)/FF1, "ff"); E! if(all==2 || (m&BSDELAY)) E! delay((m&BSDELAY)/BS1, "bs"); E! if (all) E! fprintf(stderr,"\n"); E! #define lpit(what,str) \ E! if (all==2||(lmode&what)) { \ E! fprintf(stderr,str+((lmode&what)!=0)); any++; \ E! } E if (ldisc == NTTYDISC) { E int newcrt = (lmode&(LCTLECH|LCRTBS)) == (LCTLECH|LCRTBS) && E (lmode&(LCRTERA|LCRTKIL)) == E--- 381,445 ---- E return(1); E } E E+ #define lpit(what,str) \ E+ if (all || (lmode&what)) { \ E+ fprintf(stderr,str+((lmode&what)!=0)); any++; \ E+ } E+ E prmodes(all) E+ int all; /* 0 for short display, !0 for long display */ E { E register m; E! int any, i; E! register struct special *sp; E E if(ldisc==NETLDISC) E fprintf(stderr, "net discipline, "); E! else if (ldisc==NTTYDISC) E fprintf(stderr, "new tty, "); E! else if (ldisc == 0) E fprintf(stderr, "old tty, "); E+ else E+ fprintf(stderr, "discipline %d, "); E if(mode.sg_ispeed != mode.sg_ospeed) { E! fprintf(stderr,"input speed %u baud", speed[mode.sg_ispeed]); E! fprintf(stderr,"output speed %u baud", speed[mode.sg_ospeed]); E } else E! fprintf(stderr,"speed %u baud", speed[mode.sg_ispeed]); E if (all) E fprintf(stderr, ", %d rows, %d columns", win.ws_row, win.ws_col); E! fprintf(stderr, all ? "\n" : "; "); E m = mode.sg_flags; E! if (all) { E if(m & EVENP) fprintf(stderr,"even "); E if(m & ODDP) fprintf(stderr,"odd "); E } E! if (all || m&RAW) E fprintf(stderr,"-raw "+((m&RAW)!=0)); E! if (all || (m&CRMOD)==0) E fprintf(stderr,"-nl "+((m&CRMOD)==0)); E! if (all || (m&ECHO)==0) E fprintf(stderr,"-echo "+((m&ECHO)!=0)); E! if (all || (m&TANDEM)) E fprintf(stderr,"-tandem "+((m&TANDEM)!=0)); E fprintf(stderr,"-tabs "+((m&XTABS)!=XTABS)); E! if (all || (m&CBREAK)) E fprintf(stderr,"-cbreak "+((m&CBREAK)!=0)); E! lpit(LRTSCTS, "-rtscts "); E! if (all) E! { E! fputc('\n', stderr); E! if (mstate != -1) E! { E! fprintf(stderr, "modem control: "); E! fprintf(stderr,"-dcd "+((mstate & TIOCM_CD)!=0)); E! fprintf(stderr,"-dsr "+((mstate & TIOCM_DSR)!=0)); E! fprintf(stderr,"-dtr "+((mstate & TIOCM_DTR)!=0)); E! fprintf(stderr,"-cts "+((mstate & TIOCM_CTS)!=0)); E! fprintf(stderr,"-rts "+((mstate & TIOCM_RTS)!=0)); E! fputc('\n', stderr); E! } E! } E if (ldisc == NTTYDISC) { E int newcrt = (lmode&(LCTLECH|LCRTBS)) == (LCTLECH|LCRTBS) && E (lmode&(LCRTERA|LCRTKIL)) == E*************** E*** 393,399 **** E ((mode.sg_ospeed > B300) ? LCRTERA|LCRTKIL : 0); E int nothing = 1; E if (newcrt) { E! if (all==2) E fprintf(stderr, "crt: (crtbs crterase crtkill ctlecho) "); E else E fprintf(stderr, "crt "); E--- 446,452 ---- E ((mode.sg_ospeed > B300) ? LCRTERA|LCRTKIL : 0); E int nothing = 1; E if (newcrt) { E! if (all) E fprintf(stderr, "crt: (crtbs crterase crtkill ctlecho) "); E else E fprintf(stderr, "crt "); E*************** E*** 406,413 **** E lpit(LPRTERA, "-prterase "); E } E lpit(LTOSTOP, "-tostop "); E! if (all==2) { E! fprintf(stderr, "\n"); E any = 0; E nothing = 0; E } E--- 459,466 ---- E lpit(LPRTERA, "-prterase "); E } E lpit(LTOSTOP, "-tostop "); E! if (all) { E! fputc('\n', stderr); E any = 0; E nothing = 0; E } E*************** E*** 417,567 **** E lpit(LPASS8, "-pass8 "); E lpit(LNOHANG, "-nohang "); E if (any) { E! fprintf(stderr,"\n"); E any = 0; E nothing = 0; E } E- #ifdef notdef E- lpit(LETXACK, "-etxack "); E- #endif E lpit(LPENDIN, "-pendin "); E lpit(LDECCTQ, "-decctlq "); E lpit(LNOFLSH, "-noflsh "); E if (any || nothing) E! fprintf(stderr,"\n"); E } else if (!all) E! fprintf(stderr,"\n"); E! if (all) { E! switch (ldisc) { E E! case 0: E! fprintf(stderr,"\ E! erase kill intr quit stop eof\ E! \n"); E! pcol(mode.sg_erase, -1); E! pcol(mode.sg_kill, -1); E! pcol(tc.t_intrc, -1); E! pcol(tc.t_quitc, -1); E! pcol(tc.t_stopc, tc.t_startc); E! pcol(tc.t_eofc, tc.t_brkc); E! fprintf(stderr,"\n"); E! break; E! E! case NTTYDISC: E! fprintf(stderr,"\ E! erase kill werase rprnt flush lnext susp intr quit stop eof\ E! \n"); E! pcol(mode.sg_erase, -1); E! pcol(mode.sg_kill, -1); E! pcol(ltc.t_werasc, -1); E! pcol(ltc.t_rprntc, -1); E! pcol(ltc.t_flushc, -1); E! pcol(ltc.t_lnextc, -1); E! pcol(ltc.t_suspc, ltc.t_dsuspc); E! pcol(tc.t_intrc, -1); E! pcol(tc.t_quitc, -1); E! pcol(tc.t_stopc, tc.t_startc); E! pcol(tc.t_eofc, tc.t_brkc); E! fprintf(stderr,"\n"); E! break; E! } E! } else if (ldisc != NETLDISC) { E! register struct special *sp; E! int first = 1; E! E! for (sp = special; sp->name; sp++) { E! if ((*sp->cp&0377) != (sp->def&0377)) { E! pit(*sp->cp, sp->name, first ? "" : ", "); E! first = 0; E! }; E! if (sp->cp == &tc.t_brkc && ldisc == 0) E! break; E! } E! if (!first) E! fprintf(stderr, "\n"); E } E } E E! pcol(ch1, ch2) E! int ch1, ch2; E! { E! int nout = 0; E E! ch1 &= 0377; E! ch2 &= 0377; E! if (ch1 == ch2) E! ch2 = 0377; E! for (; ch1 != 0377 || ch2 != 0377; ch1 = ch2, ch2 = 0377) { E! if (ch1 == 0377) E! continue; E! if (ch1 & 0200) { E! fprintf(stderr, "M-"); E! nout += 2; E! ch1 &= ~ 0200; E } E! if (ch1 == 0177) { E! fprintf(stderr, "^"); E! nout++; E! ch1 = '?'; E! } else if (ch1 < ' ') { E! fprintf(stderr, "^"); E! nout++; E! ch1 += '@'; E } E! fprintf(stderr, "%c", ch1); E! nout++; E! if (ch2 != 0377) { E! fprintf(stderr, "/"); E! nout++; E } E } E- while (nout < 7) { E- fprintf(stderr, " "); E- nout++; E- } E- } E- E- pit(what, itsname, sep) E- unsigned what; E- char *itsname, *sep; E- { E- E- what &= 0377; E- fprintf(stderr, "%s%s", sep, itsname); E- if (what == 0377) { E- fprintf(stderr, " "); E- return; E- } E- fprintf(stderr, " = "); E- if (what & 0200) { E- fprintf(stderr, "M-"); E- what &= ~ 0200; E- } E- if (what == 0177) { E- fprintf(stderr, "^"); E- what = '?'; E- } else if (what < ' ') { E- fprintf(stderr, "^"); E- what += '@'; E- } E- fprintf(stderr, "%c", what); E- } E- E- delay(m, s) E- char *s; E- { E- E- if(m) E- fprintf(stderr,"%s%d ", s, m); E- } E- E- unsigned speed[] = { E- 0,50,75,110,134,150,200,300,600,1200,1800,2400,4800,9600,19200,38400 E- }; E- E- prspeed(c, s) E- char *c; E- { E- E- fprintf(stderr,"%s%u baud", c, speed[s]); E- } E--- 470,531 ---- E lpit(LPASS8, "-pass8 "); E lpit(LNOHANG, "-nohang "); E if (any) { E! fputc('\n', stderr); E any = 0; E nothing = 0; E } E lpit(LPENDIN, "-pendin "); E lpit(LDECCTQ, "-decctlq "); E lpit(LNOFLSH, "-noflsh "); E if (any || nothing) E! fputc('\n', stderr); E } else if (!all) E! fputc('\n', stderr); E E! if (all) { E! for (i = 0, sp = special; i < 9; i++, sp++) E! fprintf(stderr, Nfmt, sp->name); E! fputc('\n', stderr); E! for (i = 0, sp = special; i < 9; i++, sp++) E! pit(sp); E! fputc('\n', stderr); E! for (i = 9, sp = &special[9]; sp->name; i++, sp++) E! fprintf(stderr, Nfmt, sp->name); E! fputc('\n', stderr); E! for (i = 9, sp = &special[9]; sp->name; i++, sp++) E! pit(sp); E! fputc('\n', stderr); E } E } E E! pit(sp) E! struct special *sp; E! { E! register int c = *sp->cp & 0xff; E! char junk[6]; E! register char *p = junk; E E! if (c == 0xff) E! { E! fprintf(stderr, Nfmt, ""); E! return; E } E! if (c & 0200) E! { E! *p++ = 'M'; E! *p++ = '-'; E! c &= ~ 0200; E } E! if (c == 0177) E! { E! *p++ = '^'; E! *p++ = '?'; E } E+ else if (c < ' ') E+ { E+ *p++ = '^'; E+ *p++ = c += '@'; E+ } E+ *p++ = '\0'; E+ fprintf(stderr, Nfmt, junk); E } E*** /usr/src/bin/tcsh/ed.init.c.old Wed Aug 21 10:24:27 1991 E--- /usr/src/bin/tcsh/ed.init.c Fri Mar 28 14:38:03 1997 E*************** E*** 1,4 **** E- /* $Header: /home/hyperion/mu/christos/src/sys/tcsh-6.00/RCS/ed.init.c,v 3.0 1991/07/04 21:49:28 christos Exp $ */ E /* E * ed.init.c: Editor initializations E */ E--- 1,3 ---- E*************** E*** 37,43 **** E #include "config.h" E #if !defined(lint) && !defined(pdp11) E static char *rcsid() E! { return "$Id: ed.init.c,v 3.0 1991/07/04 21:49:28 christos Exp $"; } E #endif E E #include "sh.h" E--- 36,42 ---- E #include "config.h" E #if !defined(lint) && !defined(pdp11) E static char *rcsid() E! { return "$Id: ed.init.c,v 3.1 1997/3/28 21:49:28 sms Exp $"; } E #endif E E #include "sh.h" E*************** E*** 385,396 **** E T_Tabs = 1; E } E E! if (T_Tabs) { /* order of &= and |= is important to XTABS */ E! nb.sg_flags &= ~(CBREAK | RAW | LCASE | XTABS | VTDELAY | ALLDELAY); E nb.sg_flags |= (ECHO | CRMOD | ANYP); E } E else { E! nb.sg_flags &= ~(CBREAK | RAW | LCASE | VTDELAY | ALLDELAY); E nb.sg_flags |= (ECHO | CRMOD | XTABS | ANYP); E } E nlb &= ~(LPRTERA); /* let 8-bit mode stand as set */ E--- 384,395 ---- E T_Tabs = 1; E } E E! if (T_Tabs) { E! nb.sg_flags &= ~(CBREAK | RAW | XTABS); E nb.sg_flags |= (ECHO | CRMOD | ANYP); E } E else { E! nb.sg_flags &= ~(CBREAK | RAW); E nb.sg_flags |= (ECHO | CRMOD | XTABS | ANYP); E } E nlb &= ~(LPRTERA); /* let 8-bit mode stand as set */ E*************** E*** 523,534 **** E # endif /* hpux */ E # endif /* OREO || hpux || _IBMR2 */ E #else /* GSTTY */ E! if (T_Tabs) { /* order of &= and |= is important to XTABS */ E! xb.sg_flags &= ~(RAW | ECHO | LCASE | XTABS | VTDELAY | ALLDELAY); E xb.sg_flags |= (CBREAK | CRMOD | ANYP); E } E else { E! xb.sg_flags &= ~(RAW | ECHO | LCASE | VTDELAY | ALLDELAY); E xb.sg_flags |= (CBREAK | CRMOD | ANYP | XTABS); E } E E--- 522,533 ---- E # endif /* hpux */ E # endif /* OREO || hpux || _IBMR2 */ E #else /* GSTTY */ E! if (T_Tabs) { E! xb.sg_flags &= ~(RAW | ECHO | XTABS); E xb.sg_flags |= (CBREAK | CRMOD | ANYP); E } E else { E! xb.sg_flags &= ~(RAW | ECHO); E xb.sg_flags |= (CBREAK | CRMOD | ANYP | XTABS); E } E E*************** E*** 846,852 **** E T_Tabs = CanWeTab(); E } E E! nb.sg_flags &= ~(CBREAK | RAW | LCASE | VTDELAY | ALLDELAY); E nb.sg_flags |= (ECHO | CRMOD | ANYP); E if (T_Tabs) { /* order of &= and |= is important to XTABS */ E nb.sg_flags &= ~XTABS; E--- 845,851 ---- E T_Tabs = CanWeTab(); E } E E! nb.sg_flags &= ~(CBREAK | RAW); E nb.sg_flags |= (ECHO | CRMOD | ANYP); E if (T_Tabs) { /* order of &= and |= is important to XTABS */ E nb.sg_flags &= ~XTABS; E*************** E*** 857,867 **** E E xb.sg_flags = testsgb.sg_flags; E if (T_Tabs) { E! xb.sg_flags &= ~(RAW | ECHO | LCASE | XTABS | VTDELAY | ALLDELAY); E xb.sg_flags |= (CBREAK | CRMOD | ANYP); E } E else { E! xb.sg_flags &= ~(RAW | ECHO | LCASE | VTDELAY | ALLDELAY); E xb.sg_flags |= (CBREAK | CRMOD | ANYP | XTABS); E } E E--- 856,866 ---- E E xb.sg_flags = testsgb.sg_flags; E if (T_Tabs) { E! xb.sg_flags &= ~(RAW | ECHO | XTABS); E xb.sg_flags |= (CBREAK | CRMOD | ANYP); E } E else { E! xb.sg_flags &= ~(RAW | ECHO); E xb.sg_flags |= (CBREAK | CRMOD | ANYP | XTABS); E } E E*** /usr/src/etc/gettytab.old Sun Dec 1 15:35:15 1996 E--- /usr/src/etc/gettytab Fri Mar 28 21:01:16 1997 E*************** E*** 2,8 **** E # All rights reserved. The Berkeley software License Agreement E # specifies the terms and conditions for redistribution. E # E! # @(#)gettytab 5.7.1 (2.11BSD GTE) 12/9/94 E # E # E # Most of the table entries here are just copies of the E--- 2,8 ---- E # All rights reserved. The Berkeley software License Agreement E # specifies the terms and conditions for redistribution. E # E! # @(#)gettytab 5.7.2 (2.11BSD GTE) 1997/3/28 E # E # E # Most of the table entries here are just copies of the E*************** E*** 16,22 **** E # entries, and in cases where getty is called with no table name E # E default:\ E! :ap:fd#1000:im=\r\n\r\n2.11 BSD UNIX (%h) (%t)\r\n\r\r\n\r:sp#1200: E E # E # Fixed speed entries E--- 16,22 ---- E # entries, and in cases where getty is called with no table name E # E default:\ E! :ap:im=\r\n\r\n2.11 BSD UNIX (%h) (%t)\r\n\r\r\n\r:sp#1200: E E # E # Fixed speed entries E*************** E*** 29,45 **** E # be assigned to any table desired (hopefully the same speed). E # E a|std.110|110-baud:\ E! :nd#1:cd#1:sp#110: E b|std.134|134.5-baud:\ E! :ep:nd#1:cd#2:ff#1:td#1:sp#134:ht:nl: E 1|std.150|150-baud:\ E! :ep:nd#1:cd#2:td#1:fd#1:sp#150:ht:nl:lm=\E\72\6\6\17login\72 : E c|std.300|300-baud:\ E! :nd#1:cd#1:sp#300: E d|std.600|600-baud:\ E! :nd#1:cd#1:sp#600: E f|std.1200|1200-baud:\ E! :fd#1:sp#1200: E 6|std.2400|2400-baud:\ E :sp#2400:ht: E 7|std.4800|4800-baud:\ E--- 29,45 ---- E # be assigned to any table desired (hopefully the same speed). E # E a|std.110|110-baud:\ E! :sp#110: E b|std.134|134.5-baud:\ E! :ep:sp#134:ht:nl: E 1|std.150|150-baud:\ E! :ep:sp#150:ht:nl:lm=\E\72\6\6\17login\72 : E c|std.300|300-baud:\ E! :sp#300: E d|std.600|600-baud:\ E! :sp#600: E f|std.1200|1200-baud:\ E! :sp#1200: E 6|std.2400|2400-baud:\ E :sp#2400:ht: E 7|std.4800|4800-baud:\ E*************** E*** 50,61 **** E :sp#19200: E E # E # Dial in rotary tables, speed selection via 'break' E # E 0|d300|Dial-300:\ E! :nx=d1200:cd#2:sp#300: E d1200|Dial-1200:\ E! :nx=d150:fd#1:sp#1200: E d150|Dial-150:\ E :nx=d110:lm@:tc=150-baud: E d110|Dial-110:\ E--- 50,68 ---- E :sp#19200: E E # E+ # Hardware flow control lines E+ # E+ t9600-hf:hf:sp#9600 E+ t19200-hf:hf:sp#19200 E+ t38400-hf:hf:sp#38400 E+ E+ # E # Dial in rotary tables, speed selection via 'break' E # E 0|d300|Dial-300:\ E! :nx=d1200:sp#300: E d1200|Dial-1200:\ E! :nx=d150:sp#1200: E d150|Dial-150:\ E :nx=d110:lm@:tc=150-baud: E d110|Dial-110:\ E*************** E*** 68,83 **** E :tc=110-baud: E E 4|Console|Console Decwriter II:\ E! :nd@:cd@:rw:tc=300-baud: E E e|Console-1200|Console Decwriter III:\ E! :fd@:nd@:cd@:rw:tc=1200-baud: E E l|lsi chess terminal:\ E :sp#300: E E X|Xwindow|X window system:\ E! :fd@:nd@:cd@:rw:sp#9600: E E # E # Fast dialup terminals, 2400/1200/300 rotary (can start either way) E--- 75,90 ---- E :tc=110-baud: E E 4|Console|Console Decwriter II:\ E! :rw:tc=300-baud: E E e|Console-1200|Console Decwriter III:\ E! :rw:tc=1200-baud: E E l|lsi chess terminal:\ E :sp#300: E E X|Xwindow|X window system:\ E! :rw:sp#9600: E E # E # Fast dialup terminals, 2400/1200/300 rotary (can start either way) E*** /usr/src/games/hack/hack.tty.c.old Thu Dec 12 00:14:32 1985 E--- /usr/src/games/hack/hack.tty.c Fri Mar 28 14:44:59 1997 E*************** E*** 1,58 **** E /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ E! /* hack.tty.c - version 1.0.3 */ E! /* With thanks to the people who sent code for SYSV - hpscdi!jon, E! arnold@ucsf-cgl, wcs@bo95b, cbcephus!pds and others. */ E E #include "hack.h" E #include E E /* E- * The distinctions here are not BSD - rest but rather USG - rest, as E- * BSD still has the old sgttyb structure, but SYSV has termio. Thus: E- */ E- #ifdef BSD E- #define V7 E- #else E- #define USG E- #endif BSD E- E- /* E * Some systems may have getchar() return EOF for various reasons, and E * we should not quit before seeing at least NR_OF_EOFS consecutive EOFs. E * Also see the comment in config.h on `VERSION7'. E */ E- #ifndef BSD E #define NR_OF_EOFS 20 E- #else E- #ifdef VERSION7 E- #define NR_OF_EOFS 20 E- #endif VERSION7 E- #endif BSD E E- E- #ifdef USG E- E- #include E- #define termstruct termio E- #define kill_sym c_cc[VKILL] E- #define erase_sym c_cc[VERASE] E- #define EXTABS TAB3 E- #define tabflgs c_oflag E- #define echoflgs c_lflag E- #define cbrkflgs c_lflag E- #define CBRKMASK ICANON E- #define CBRKON ! /* reverse condition */ E- #define OSPEED(x) ((x).c_cflag & CBAUD) E- #define GTTY(x) (ioctl(0, TCGETA, x)) E- #define STTY(x) (ioctl(0, TCSETA, x)) /* TCSETAF? TCSETAW? */ E- E- #else /* V7 */ E- E #include E #define termstruct sgttyb E #define kill_sym sg_kill E #define erase_sym sg_erase E- #define EXTABS XTABS E #define tabflgs sg_flags E #define echoflgs sg_flags E #define cbrkflgs sg_flags E--- 1,20 ---- E /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ E! /* hack.tty.c - version 1.0.4 (2.11BSD) 1997/3/28 */ E E #include "hack.h" E #include E E /* E * Some systems may have getchar() return EOF for various reasons, and E * we should not quit before seeing at least NR_OF_EOFS consecutive EOFs. E * Also see the comment in config.h on `VERSION7'. E */ E #define NR_OF_EOFS 20 E E #include E #define termstruct sgttyb E #define kill_sym sg_kill E #define erase_sym sg_erase E #define tabflgs sg_flags E #define echoflgs sg_flags E #define cbrkflgs sg_flags E*************** E*** 62,69 **** E #define GTTY(x) (gtty(0, x)) E #define STTY(x) (stty(0, x)) E E- #endif USG E- E extern short ospeed; E static char erase_char, kill_char; E static boolean settty_needed = FALSE; E--- 24,29 ---- E*************** E*** 84,91 **** E getioctls(); E E /* do not expand tabs - they might be needed inside a cm sequence */ E! if(curttyb.tabflgs & EXTABS) { E! curttyb.tabflgs &= ~EXTABS; E setctty(); E } E settty_needed = TRUE; E--- 44,51 ---- E getioctls(); E E /* do not expand tabs - they might be needed inside a cm sequence */ E! if(curttyb.tabflgs & XTABS) { E! curttyb.tabflgs &= ~XTABS; E setctty(); E } E settty_needed = TRUE; E*************** E*** 125,135 **** E if((curttyb.cbrkflgs & CBRKMASK) != cf){ E curttyb.cbrkflgs &= ~CBRKMASK; E curttyb.cbrkflgs |= cf; E- #ifdef USG E- /* be satisfied with one character; no timeout */ E- curttyb.c_cc[VMIN] = 1; /* was VEOF */ E- curttyb.c_cc[VTIME] = 0; /* was VEOL */ E- #endif USG E change++; E } E if(change){ E--- 85,90 ---- E*** /usr/src/games/snake/move.c.old Thu May 30 08:44:38 1985 E--- /usr/src/games/snake/move.c Fri Mar 28 14:41:02 1997 E*************** E*** 4,12 **** E * specifies the terms and conditions for redistribution. E */ E E! #ifndef lint E! static char sccsid[] = "@(#)move.c 5.1 (Berkeley) 5/30/85"; E! #endif not lint E E /************************************************************************* E * E--- 4,12 ---- E * specifies the terms and conditions for redistribution. E */ E E! #if !defined(lint) && defined(DOSCCS) E! static char sccsid[] = "@(#)move.c 5.1.1 (2.11BSD) 1997/3/28"; E! #endif E E /************************************************************************* E * E*************** E*** 615,621 **** E E gtty(0, &orig); E new=orig; E! new.sg_flags &= ~(ECHO|CRMOD|ALLDELAY|XTABS); E new.sg_flags |= CBREAK; E signal(SIGINT,stop); E ospeed = orig.sg_ospeed; E--- 615,621 ---- E E gtty(0, &orig); E new=orig; E! new.sg_flags &= ~(ECHO|CRMOD|XTABS); E new.sg_flags |= CBREAK; E signal(SIGINT,stop); E ospeed = orig.sg_ospeed; E*** /usr/src/libexec/getty/Makefile.old Sat Nov 16 16:30:23 1996 E--- /usr/src/libexec/getty/Makefile Mon Apr 28 19:40:10 1997 E*************** E*** 3,9 **** E # All rights reserved. The Berkeley software License Agreement E # specifies the terms and conditions for redistribution. E # E! # @(#)Makefile 5.1.1 (2.11BSD) 1996/11/16 E # E DESTDIR= E CFLAGS= -O E--- 3,9 ---- E # All rights reserved. The Berkeley software License Agreement E # specifies the terms and conditions for redistribution. E # E! # @(#)Makefile 5.1.2 (2.11BSD) 1997/4/28 E # E DESTDIR= E CFLAGS= -O E*************** E*** 16,24 **** E getty: ${OBJS} E ${CC} ${SEPFLAG} -o getty ${OBJS} E E! install: all gettytab E! install -s getty ${DESTDIR}/usr/libexec/getty E! -install -c -m 444 gettytab ${DESTDIR}/etc/gettytab E E clean: E rm -f getty ${OBJS} a.out core errs E--- 16,23 ---- E getty: ${OBJS} E ${CC} ${SEPFLAG} -o getty ${OBJS} E E! install: all E! install -s -m 555 -o bin -g bin getty ${DESTDIR}/usr/libexec/getty E E clean: E rm -f getty ${OBJS} a.out core errs E*** /usr/src/libexec/getty/gettytab.h.old Fri Dec 9 22:32:21 1994 E--- /usr/src/libexec/getty/gettytab.h Fri Mar 28 20:34:51 1997 E*************** E*** 3,9 **** E * All rights reserved. The Berkeley software License Agreement E * specifies the terms and conditions for redistribution. E * E! * @(#)gettytab.h 5.2.2 (2.11BSD GTE) 12/9/94 E */ E E /* E--- 3,9 ---- E * All rights reserved. The Berkeley software License Agreement E * specifies the terms and conditions for redistribution. E * E! * @(#)gettytab.h 5.2.2 (2.11BSD GTE) 1997/3/28 E */ E E /* E*************** E*** 64,82 **** E #define IS gettynums[0].value E #define OS gettynums[1].value E #define SP gettynums[2].value E! #define ND gettynums[3].value E! #define CD gettynums[4].value E! #define TD gettynums[5].value E! #define FD gettynums[6].value E! #define BD gettynums[7].value E! #define TO gettynums[8].value E! #define F0 gettynums[9].value E! #define F0set gettynums[9].set E! #define F1 gettynums[10].value E! #define F1set gettynums[10].set E! #define F2 gettynums[11].value E! #define F2set gettynums[11].set E! #define PF gettynums[12].value E E /* E * Boolean values. E--- 64,77 ---- E #define IS gettynums[0].value E #define OS gettynums[1].value E #define SP gettynums[2].value E! #define TO gettynums[3].value E! #define F0 gettynums[4].value E! #define F0set gettynums[4].set E! #define F1 gettynums[5].value E! #define F1set gettynums[5].set E! #define F2 gettynums[6].value E! #define F2set gettynums[6].set E! #define PF gettynums[7].value E E /* E * Boolean values. E*************** E*** 103,108 **** E--- 98,104 ---- E #define UB gettyflags[16].value E #define AB gettyflags[17].value E #define DX gettyflags[18].value E+ #define HF gettyflags[19].value E E int getent(); E long getnum(); E*** /usr/src/libexec/getty/init.c.old Fri Dec 9 22:31:55 1994 E--- /usr/src/libexec/getty/init.c Fri Mar 28 20:35:43 1997 E*************** E*** 5,11 **** E */ E E #if !defined(lint) && defined(DOSCCS) E! static char sccsid[] = "@(#)init.c 5.2.1 (2.11BSD GTE) 12/9/94"; E #endif E E /* E--- 5,11 ---- E */ E E #if !defined(lint) && defined(DOSCCS) E! static char sccsid[] = "@(#)init.c 5.2.2 (2.11BSD GTE) 1997/3/28"; E #endif E E /* E*************** E*** 53,63 **** E { "is" }, /* input speed */ E { "os" }, /* output speed */ E { "sp" }, /* both speeds */ E- { "nd" }, /* newline delay */ E- { "cd" }, /* carriage-return delay */ E- { "td" }, /* tab delay */ E- { "fd" }, /* form-feed delay */ E- { "bd" }, /* backspace delay */ E { "to" }, /* timeout */ E { "f0" }, /* output flags */ E { "f1" }, /* input flags */ E--- 53,58 ---- E*************** E*** 86,90 **** E--- 81,86 ---- E { "ub", 0 }, /* unbuffered output */ E { "ab", 0 }, /* auto-baud detect with '\r' */ E { "dx", 0 }, /* set decctlq */ E+ { "hf", 0 }, /* set HardwareFlowcontrol */ E { 0 } E }; E*** /usr/src/libexec/getty/subr.c.old Fri Dec 9 22:43:32 1994 E--- /usr/src/libexec/getty/subr.c Fri Mar 28 21:02:25 1997 E*************** E*** 5,11 **** E */ E E #if !defined(lint) && defined(DOSCCS) E! static char sccsid[] = "@(#)subr.c 5.4.1 (2.11BSD GTE) 12/9/94"; E #endif E E /* E--- 5,11 ---- E */ E E #if !defined(lint) && defined(DOSCCS) E! static char sccsid[] = "@(#)subr.c 5.4.2 (2.11BSD GTE) 1997/3/28"; E #endif E E /* E*************** E*** 148,159 **** E f |= ODDP; E else if (EP) E f |= EVENP; E! E if (NL) E f |= CRMOD; E E- f |= delaybits(); E- E if (n == 1) { /* read mode flags */ E if (RW) E f |= RAW; E--- 148,158 ---- E f |= ODDP; E else if (EP) E f |= EVENP; E! if (HF) E! f |= RTSCTS; E if (NL) E f |= CRMOD; E E if (n == 1) { /* read mode flags */ E if (RW) E f |= RAW; E*************** E*** 164,263 **** E E if (!HT) E f |= XTABS; E- E if (n == 0) E return (f); E- E if (CB) E f |= CRTBS; E- E if (CE) E f |= CRTERA; E- E if (CK) E f |= CRTKIL; E- E if (PE) E f |= PRTERA; E- E if (EC) E f |= ECHO; E- E if (XC) E f |= CTLECH; E- E if (DX) E f |= DECCTQ; E- E return (f); E- } E- E- struct delayval { E- unsigned delay; /* delay in ms */ E- int bits; E- }; E- E- /* E- * below are random guesses, I can't be bothered checking E- */ E- E- struct delayval crdelay[] = { E- 1, CR1, E- 2, CR2, E- 3, CR3, E- 83, CR1, E- 166, CR2, E- 0, CR3, E- }; E- E- struct delayval nldelay[] = { E- 1, NL1, /* special, calculated */ E- 2, NL2, E- 3, NL3, E- 100, NL2, E- 0, NL3, E- }; E- E- struct delayval bsdelay[] = { E- 1, BS1, E- 0, 0, E- }; E- E- struct delayval ffdelay[] = { E- 1, FF1, E- 1750, FF1, E- 0, FF1, E- }; E- E- struct delayval tbdelay[] = { E- 1, TAB1, E- 2, TAB2, E- 3, XTABS, /* this is expand tabs */ E- 100, TAB1, E- 0, TAB2, E- }; E- E- delaybits() E- { E- register f; E- E- f = adelay(CD, crdelay); E- f |= adelay(ND, nldelay); E- f |= adelay(FD, ffdelay); E- f |= adelay(TD, tbdelay); E- f |= adelay(BD, bsdelay); E- return (f); E- } E- E- adelay(ms, dp) E- register long ms; E- register struct delayval *dp; E- { E- if (ms == 0) E- return (0); E- while (dp->delay && ms > dp->delay) E- dp++; E- return (dp->bits); E } E E char editedhost[32]; E--- 163,185 ---- E*** /usr/src/local/zmodem/rbsb.c.old Sun Oct 25 15:10:38 1992 E--- /usr/src/local/zmodem/rbsb.c Fri Mar 28 14:31:26 1997 E*************** E*** 1,5 **** E--- 1,8 ---- E /* E * E+ * Rev 1997-3-28 E+ * Remove use of alldelay and lcase tty flags - they're gone (at last). E+ * E * Rev 5-09-89 E * This file contains Unix specific code for setting terminal modes, E * very little is specific to ZMODEM or YMODEM per se (that code is in E*************** E*** 258,264 **** E tch.t_intrc = Zmodem ? 03:030; /* Interrupt char */ E #endif E tty.sg_flags |= (ODDP|EVENP|CBREAK); E! tty.sg_flags &= ~(ALLDELAY|CRMOD|ECHO|LCASE); E ioctl(0, TIOCSETP, &tty); E ioctl(0, TIOCSETC, &tch); E #ifdef LLITOUT E--- 261,267 ---- E tch.t_intrc = Zmodem ? 03:030; /* Interrupt char */ E #endif E tty.sg_flags |= (ODDP|EVENP|CBREAK); E! tty.sg_flags &= ~(CRMOD|ECHO); E ioctl(0, TIOCSETP, &tty); E ioctl(0, TIOCSETC, &tch); E #ifdef LLITOUT SHAR_EOF chmod 644 '/tmp/diffs.369' fi exit 0 # End of shell archive