Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.1 6/24/83; site umcp-cs.UUCP Path: utzoo!watmath!clyde!cbosgd!ihnp4!qantel!lll-crg!gymble!umcp-cs!chris From: chris@umcp-cs.UUCP (Chris Torek) Newsgroups: net.unix Subject: Re: How does litout work Message-ID: <2360@umcp-cs.UUCP> Date: Fri, 29-Nov-85 15:33:33 EST Article-I.D.: umcp-cs.2360 Posted: Fri Nov 29 15:33:33 1985 Date-Received: Sat, 30-Nov-85 06:56:34 EST References: <390@oscvax.UUCP> <170@brl-tgr.ARPA> Organization: U of Maryland, Computer Science Dept., College Park, MD Lines: 54 In article <170@brl-tgr.ARPA> gwyn@brl-tgr.ARPA (Doug Gwyn ) writes: >> I seem to recall that LITOUT was slightly buggy and you had to go >> thru some special contortions to get it to work properly. > The word was that LITOUT would not stick unless you set it a > second time. No: The problem was that the device drivers did not call the `param' routine when changing the local mode word. Only TIOCSETP and TIOCSETN would force a call. With one of these buggy drivers, to set LITOUT mode, use something like the routine below. #include /* * Set LITOUT mode on the tty line corresponding to the * descriptor `fd'. Since you may not have installed the * (trivial) fix in your kernel for the bug, we use a * kludge. * * The fix: In each tty device driver, find the code for * ioctl (e.g., `dhioctl' or `dzioctl'). There will be a * bit of code that looks like this: * * if (cmd == TIOCSETP || cmd == TIOCSETN) * * Change the `if' statement to read: * * if (cmd == TIOCSETP || cmd == TIOCSETN || cmd == TIOCLSET || * cmd == TIOCLBIS || cmd == TIOCLBIC) * */ set_litout_with_bug_workaround(fd) int fd; { int litout = LITOUT; struct sgttyb sg; if (ioctl(fd, TIOCLBIS, &litout)) return (-1); /* probably not a tty line */ /* * Here is the workaround. */ if (ioctl(fd, TIOCGETP, &sg)) return (-1); if (ioctl(fd, TIOCSETP, &sg)) return (-1); return (0); } -- In-Real-Life: Chris Torek, Univ of MD Comp Sci Dept (+1 301 454 4251) UUCP: seismo!umcp-cs!chris CSNet: chris@umcp-cs ARPA: chris@mimsy.umd.edu