home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!opl.com!hri.com!noc.near.net!meiko.com!mike
- From: mike@meiko.com (Mike Stok)
- Newsgroups: comp.unix.programmer
- Subject: termios vs. ioctl (SunOS 4.1.1)
- Message-ID: <1992Dec29.151426.26933@meiko.com>
- Date: 29 Dec 92 15:14:26 GMT
- Sender: news@meiko.com
- Organization: Meiko Scientific Corp.
- Lines: 27
-
- I would like to know what the equivalent code using struct termios
- would be for:
-
- struct sgttyb sg;
- ioctl(fd, TIOCGETP, &sg);
- sg.sg_flags = O_RAW;
- ioctl(fd, TIOCSETP, &sg);
-
- The following fragment comes pretty close, but isn't exactly the same
-
- tcgetattr (fd, &termios);
- termios.c_iflag &= ~(BRKINT | ISTRIP | IMAXBEL);
- termios.c_oflag &= ~(PARENB | CSIZE);
- termios.c_oflag |= CS8;
- termios.c_iflag &= ~(ICRNL | IXON);
- termios.c_lflag &= ~(ISIG | ICANON | ECHO);
- tcsetattr (fd, TCSANOW, &termios);
-
- Any suggestions would be most welcome (having zipped through various
- bits of TFM several times...)
-
- Mike
- --
- The "usual disclaimers" apply. |
- Mike Stok |
- mike@meiko.com |
- Meiko tel: (617) 890 7676 |
-