Path: utzoo!utgpu!news-server.csri.toronto.edu!rutgers!apple!mips!zaphod.mps.ohio-state.edu!pacific.mps.ohio-state.edu!davis From: davis@pacific.mps.ohio-state.edu ("John E. Davis") Newsgroups: comp.unix.programmer Subject: BSD ioctl question Message-ID: Date: 9 Apr 91 09:56:35 GMT Sender: news@pacific.mps.ohio-state.edu Reply-To: davis@pacific.mps.ohio-state.edu (John E. Davis) Distribution: comp Organization: "Dept. of Physics, The Ohio State University" Lines: 50 Hi, This is a BSD unix question. I to read a character in RAW mode from, say, file descriptor 2. Raw turns off all input/output processing. However, I only want input processing turned off. This is not the same as CBREAK. CBREAK still does input processing on the special characters ^Z (stop), ^\ (quit), etc... which I want turned off. So my question is this: from within a C program how do I accomplish the above objective? Currently I have: { . . . #define TTY_DESCR 2 extern int ioctl(int, int, ...); #include struct sgttyb OLDTTY; . . void init_io() { struct sgttyb newtty; ioctl(TTY_DESCR, TIOCGETP, &OLDTTY); newtty = OLDTTY; newtty.sg_flags |= CBREAK; newtty.sg_flags &= ~(ECHO | XTABS); ioctl(TTY_DESCR, TIOCSETP, &newtty); } Here I use CBREAK mode but I want to allow all input characters to pass through unprocessed and I want output processing. What are the necessaary changes? Note: I did RTFM but all it talked about was termio which our system does not have (although for some stupid reason the man pages think so). A related question (perhaps the same question): It seems that from the shell, I can type `stty -isig' to turn off input processing on the interrupt characters (^Z, etc..). In BSD, how do I accomplish this with an ioctl? Thanks, -- John bitnet: davis@ohstpy internet: davis@pacific.mps.ohio-state.edu