Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/18/84; site uw-beaver Path: utzoo!watmath!clyde!cbosgd!ulysses!mhuxr!mhuxt!mhuxv!mhuxh!mhuxi!mhuxm!mhuxj!houxm!vax135!cornell!uw-beaver!laser-lovers From: laser-lovers@uw-beaver Newsgroups: fa.laser-lovers Subject: Re: 8 bit output (only) in 4BSD for (eg) LaserJet Message-ID: <782@uw-beaver> Date: Wed, 6-Feb-85 14:47:53 EST Article-I.D.: uw-beave.782 Posted: Wed Feb 6 14:47:53 1985 Date-Received: Thu, 7-Feb-85 03:48:15 EST Sender: daemon@uw-beaver Organization: U of Washington Computer Science Lines: 28 From: Chris Torek If you need only 8 bits of output (that is, if you can stand 7 bit input) then all you need to do to an ordinary tty line is: #include seteightbits(ttyfd) int ttyfd; { int bits; struct sgttyb sg; bits = LLITOUT; if (ioctl(ttyfd, TIOCLBIS, &bits)) return (-1); /* something went wrong */ /* theoretically we're done now, but most 4BSD drivers have a small bug, which we get around as follows: */ if (ioctl(ttyfd, TIOCGETP, &sg) || ioctl(ttyfd, TIOCSETN, &sg)) return (-1); return (0); /* success */ } You can eliminate the bug-workaround if your driver calls its param() routine on TIOCLBIS ioctl()s. (Most of them only do it for TIOCSETN and TIOCSETP; you should add TIOCLBIS, TIOCLBIC, and TIOCLSET to fix.) Chris