Annotation of researchv10no/cmd/ex/termlib/ioctl.c, revision 1.1.1.1

1.1       root        1: /*     @(#)ioctl.c     3.3     */
                      2: #include <sgtty.h>
                      3: 
                      4: static struct termcb termst;
                      5:        static int termfl, termtyp;
                      6: 
                      7: Ioctl() {
                      8:        register char *p;
                      9: 
                     10:        /*
                     11:         * SAVE TERMINAL INFO ... CB MOD (tjc)
                     12:         */
                     13:        ioctl(1,DIOCGETT,&termst);
                     14:        termfl = termst.st_flgs;
                     15:        termtyp = termst.st_termt;
                     16:        if((p = getenv("TERM")) != 0)
                     17:                if( (!strcmp(p+5, "VIRTUAL")) && (!strcmp(p+5, "virtual")))
                     18:                        return;
                     19:        termst.st_termt = 0;
                     20:        termst.st_flgs = 0;
                     21:        ioctl(1,DIOCSETT,&termst);
                     22: 
                     23: }
                     24: 
                     25: unIoctl()
                     26: {
                     27: 
                     28:        /*
                     29:         * RESTORE TERMINAL TYPE ... CB MOD
                     30:         */
                     31: 
                     32:        termst.st_termt = termtyp;
                     33:        termst.st_flgs = termfl;
                     34:        ioctl(1,DIOCSETT,&termst);
                     35: }
                     36: 
                     37: exit(i)
                     38:        int i;
                     39: {
                     40:        unIoctl();
                     41:        _exit(i);
                     42: }
                     43: 

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.