source: trunk/athena/bin/telnet/stty.diff @ 7616

Revision 7616, 1.5 KB checked in by cfields, 30 years ago (diff)
Initial revision
Line 
1*** stty.c.old  Tue May 23 13:54:29 1989
2--- stty.c      Wed Aug 23 13:42:32 1989
3***************
4*** 20,25 ****
5--- 20,28 ----
6 
7  #include <stdio.h>
8  #include <sys/ioctl.h>
9+ #include <sys/types.h>
10+ #define       NO_T_CHARS_DEFINES
11+ #include <sys/tty.h>
12 
13  struct
14  {
15***************
16*** 145,150 ****
17--- 148,156 ----
18  struct winsize win;
19  int   lmode;
20  int   oldisc, ldisc;
21+ #ifdef        TIOCGSTATE
22+ int   extproc;
23+ #endif
24 
25  struct        special {
26        char    *name;
27***************
28*** 188,193 ****
29--- 194,203 ----
30        ioctl(1, TIOCLGET, &lmode);
31        ioctl(1, TIOCGLTC, &ltc);
32        ioctl(1, TIOCGWINSZ, &win);
33+ #ifdef        TIOCGSTATE
34+       ioctl(1, TIOCGSTATE, &extproc);
35+       extproc &= TS_EXTPROC;
36+ #endif
37        if(argc == 1) {
38                prmodes(0);
39                exit(0);
40***************
41*** 292,297 ****
42--- 302,316 ----
43                        printf("%d %d\n", win.ws_row, win.ws_col);
44                        exit(0);
45                }
46+ #if   defined(TIOCEXT)
47+               if (eq("extproc") || eq("-extproc")) {
48+                       if (**argv == '-')
49+                               extproc = 0;
50+                       else
51+                               extproc = 1;
52+                       ioctl(1, TIOCEXT, &extproc);
53+               }
54+ #endif
55                for(i=0; speeds[i].string; i++)
56                        if(eq(speeds[i].string)) {
57                                mode.sg_ispeed = mode.sg_ospeed = speeds[i].speed;
58***************
59*** 438,443 ****
60--- 457,468 ----
61                lpit(LPENDIN, "-pendin ");
62                lpit(LDECCTQ, "-decctlq ");
63                lpit(LNOFLSH, "-noflsh ");
64+ #ifdef        TIOCGSTATE
65+               if (all==2||extproc) {
66+                       fprintf(stderr,"-extproc"+(extproc!=0));
67+                       any++;
68+               }
69+ #endif
70                if (any || nothing)
71                        fprintf(stderr,"\n");
72        } else if (!all)
Note: See TracBrowser for help on using the repository browser.