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!burl!ulysses!mhuxj!houxm!vax135!cornell!uw-beaver!tektronix!hplabs!hao!seismo!umcp-cs!chris From: chris@umcp-cs.UUCP (Chris Torek) Newsgroups: net.unix Subject: Re: Berkely unix (4.2) tty ioctl question Message-ID: <47@umcp-cs.UUCP> Date: Fri, 21-Sep-84 09:58:00 EDT Article-I.D.: umcp-cs.47 Posted: Fri Sep 21 09:58:00 1984 Date-Received: Wed, 26-Sep-84 03:14:58 EDT References: <2233@ihnss.UUCP> Organization: U of Maryland, Computer Science Dept., College Park, MD Lines: 27 If you do a TIOCSETP, that will wait for the output to drain; you can then do TIOCSETC and SLTC and whatever else. So you might do something like this: /* Change the terminal characters (start, stop, etc) after the output has drained. Since 4.2 doesn't provide a set-after-wait ioctl for struct tchars, we have to use TIOCSETP to allow the output to drain. To do this we need a TIOCGETP so that we don't actually change anything. Furthermore, someone should ensure that all this is done only in the foreground so that we don't get stopped and maybe have the tty characteristics change between the GETP and the SETP. */ SetCharsAfterWait (fd, t) int fd; struct tchars *t; { struct sgttyb sg; (void) ioctl (fd, TIOCGETP, &sg); (void) ioctl (fd, TIOCSETP, &sg); (void) ioctl (fd, TIOCSETC, t); } -- (This page accidently left blank.) In-Real-Life: Chris Torek, Univ of MD Comp Sci (301) 454-7690 UUCP: {seismo,allegra,brl-bmd}!umcp-cs!chris CSNet: chris@umcp-cs ARPA: chris@maryland